ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniels, Doug" <>
Subject RE: branching logic after user input
Date Tue, 06 Apr 2004 13:46:13 GMT
Here is a code snippet, you must be using the ant-contrib (
library to use <if> task:

<input message="Give me foo or bar:" validargs="foo,bar" addproperty="testProp"/>

<if> <equals arg1="${testPro} arg2="foo"/> <then>
  <copy file="foobar"/>

<else> <if> <equals arg1="${testPro} arg2="bar"/> <then>

  <copy file="barfoo"/>

       </then> </if>


To import the ant-contrib tasks into your build file you must declare it like this:
<taskdef resource="net/sf/antcontrib/">
    <pathelement location="${libpath}/ant-contrib-0.3.jar"/>

where ${libpath} is wherever you put the ant-contrib jar.

~ Doug Daniels

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message