ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shankar Unni <>
Subject RE: Conditionals
Date Wed, 22 Aug 2001 21:51:17 GMT
> I'd like to do <if testproperty="some.prop" testvalue="doIt"
> trueantcall="some_target" falseantcall="another_target"/> 

> What's the closes thing I can do to this in Ant? 

  <!-- This causes a property called "doIt.test" to be defined if
    -- the some.prop property had the value "doIt". Else, some other
    -- property will be defined. -->
  <property name="${some.prop}.test" value="dummy"/>

  <!-- now we just try both targets, one with an "if" for this
    -- name ("doIt.test"), and another with an "unless" for it. -->

  <target name="common_target" depends="some_target,another_target"/>

  <target name="some_target" if="doIt.test">

  <target name="another_target" unless="doIt.test">

View raw message