you can use the if / unless attribute of a target..
For example:
-------
<target name="help" if="missing.properties">
<echo message="Having fun yet?"/>
</target>
--------
In this case, missing.properties is set in a previous target.
Sound good?
Ylan Segal
-- Failure is not an option, it comes bundled with your Microsoft product
> -----Original Message-----
> From: Warren Hedley [mailto:whedley@SDSC.EDU]
> Sent: Wednesday, October 17, 2001 7:21 PM
> To: ant-user@jakarta.apache.org
> Subject: how do to an if statement?
>
>
> Hi folks,
>
> I've been poring through the Ant documentation and have not noticed that
> some useful tasks set the the value of a property to true if a certain
> condition is met -- the one I'm interested in is <updtodate>. However,
> I can't figure out how to do anything with that value, once I have it.
> Clearly I'm missing some fundamental -- how do you do code an "if"
> statement based on the value of a property.
>
> To complete the example: I would like to execute some commands if a
> particular file is not up-to-date, where the process of bringing it
> up to date is not covered by the standard commands. I can check
> whether the file is up-to-date, but can't figure out how to only
> execute the desired commands if it isn't.
>
> Thanks in advance.
>
> --
> Warren Hedley
>
>
|