ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geoff Meakin" <geo...@isocra.com>
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>

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

  <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>

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

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

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
perhaps

Cheers
-Geoff


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message