I don' think he wants to check if the property is set, but rather if the property is equal to a certain value. i.e. something like:
<target name="foo" if="my.property=bar">
</target>
I ended up writing a custom task to do this - basically lets you call one target from another based on a simple boolean expression that it evaluates (! & | and = between properties). Its not perfect, i.e. it doesn't handle "depends" too well, but as a side effect, it lets me call a target withint the same "Ant" unlike the <antcall> task which ends up creating a whole new Project object. This allows me to set/modify properties within the call that can then be seen by other targets outside the call (When antcall returns, the PRoject it created gets discarded, and thus so do all properties you set within the antcall).
<target name="foo_check">
<calltarget target="foo" if="my.property&!other.property"/>
</target>
Matt
On 06/13/2001 09:08:49 AM "Helliwell, Matthew" wrote:
>
> You'll be wanting to read that very nice manual and look at the if/unless
> parameters to the target task.
>
> -----Original Message-----
>
> Is it possible to execute a task only if a property has a specific value?
- Conditional task execution David Corbin
- Re: Conditional task execution Peter Donald
- Re: Conditional task execution David Corbin
- Re: Conditional task execution Stefan Bodewig
- Conditional task execution Stefano Mancarella
- RE: Conditional task execution Fran�ois Waelti
- RE: Conditional task execution Matt_Conway
- RE: Conditional task execution Helliwell, Matthew
- RE: Conditional task execution Don Taylor
- Re: Conditional task execution Larry V. Streepy, Jr.
- Forked junit task not finding TestRunne... Dani Zweig
- RE: Conditional task execution Helliwell, Matthew
- RE: Conditional task execution Jon Skeet
- Re: Conditional task execution Stefano Mancarella
- Re: Conditional task execution Stefano Mancarella
