--- Laran Evans <[EMAIL PROTECTED]> wrote:
> How would I do something like:
>
> <target name="x">
> <if test="true == ${auto-deploy}">
> <javac dest="${dir.deploy.auto}" ... />
> </if>
> <else>
> <javac dest="${dir.build}" ... />
> </else>
> </target>
>
> ?
ant-contrib has an <if> task, but using "classical
Ant" you might do:
<target name="check">
<condition property="destdir"
value="${dir.deploy.auto}">
<istrue value="${auto-deploy}" />
</condition>
<property name="destdir" value="${dir.build}" />
</target>
<target name="x" depends="check">
<javac dest="${destdir}" ... />
</target>
or, you might do this (arguable more "normal"):
<target name="x" depends="compile,deploy" />
<target name="compile">
<javac dest="${dir.build}" ... />
</target>
<target name="deploy" if="auto-deploy">
<!-- note that the if above tests the
existence of the auto-deploy property
rather than its actual value -->
<copy todir="${dir.deploy.auto}">
<fileset dir="${dir.build}" />
</copy>
</target>
HTH,
Matt
__________________________________
Do you Yahoo!?
Yahoo! Mail - now with 250MB free storage. Learn more.
http://info.mail.yahoo.com/mail_250
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]