ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geoff Meakin" <>
Subject RE: Target/flag inconsistency resolution
Date Thu, 27 Jun 2002 13:44:50 GMT
Here's one way to do it

  <target name="baz" depends="bazselect,dist">
  // yadda-yadda-yadda

  <target name="dist" depends="foo">
  // yadda-yadda-yadda

  <target name="foo" unless="foohandler" depends="checkfoo">
  // but the value of nofoo should be ignored if we are in the
  // process of building baz!
  // yadda-yadda-yadda

  <target name="checkfoo">
    <condition property="foohandler" value="true">
        <not><equals arg1="${nofoo}" arg2="$${nofoo}"/></not>
        <equals arg1="${bazselected}" arg2="$${bazselected}"/>

  <target name="bazselect">
    <property name="bazselected" value="true"/>

thus bazselected only gets set to true if baz is called,
and bazselected prevents foohandler from being true, which in turn means foo
is executed.
Note you could swap some of the unless, <not> logic to make it a bit simpler


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

View raw message