ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stirling, Scott" <>
Subject RE: Unexpected behavior with <target unless="variable">
Date Wed, 25 Feb 2004 21:40:23 GMT
> From: Basel Ahmed []
> I'm seeing some unexpected behavior within the target unless option.
> The troublesome script segment looks something like this:
> <antcall target="" />
> <target name=""
>                depends=""
>                unless="some.condition" >
> </target>
> I have verified that the condition is set (echoing to the screen).
> For some reason, Ant is executing that target and consequently its 
> dependency inspite of the true condition.  I'm using Ant 1.6.0.  
> Any ideas on what the real issue might be?

Based on your description of what you want, your unless should be on the antcall target, not
on the target.

Order of operations for depends/unless on a target is:
1. execute depends
2. evaluate unless
3. execute target, unless property is set

This order is nice (IMHO) because it allows you to use depends to target availability checks
and set the property that the if/unless uses to toggle the target's executability.

Scott Stirling
Workscape, Inc.

This message is intended only for the use of the intended recipient and
may contain information that is PRIVILEGED and/or CONFIDENTIAL.  If you
are not the intended recipient, you are hereby notified that any use,
dissemination, disclosure or copying of this communication is strictly
prohibited.  If you have received this communication in error, please
destroy all copies of this message and its attachments and notify us

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

View raw message