ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shawn Castrianni <>
Subject RE: Target unless question
Date Thu, 13 Aug 2009 19:14:23 GMT
The if/unless apply to the target they are specified on ONLY.  They do not have any effect
on the depends targets.  I don't like this either.  I posted about this very subject earlier
this year.  Here is a link to it:

Shawn Castrianni

-----Original Message-----
From: Scot P. Floess [] 
Sent: Thursday, August 13, 2009 2:09 PM
Subject: Target unless question


I was under the impression that using an unless attribute on a target will 
not run the target if that property is set...  However, if there are is a 
depends attribute defined, the targets in the depend are run regardless?

Is this correct?

For example consider the following:

<project default="C">
     <target name="A">
         <echo message = "A"/>

     <target name="B">
         <echo message = "B"/>

     <target name="C" unless = "stop" depends="A, B"/>

When I run as either:

ant -Dstop="true"


ant -Dstop=true

I get the following results:

Buildfile: build.xml

      [echo] A

      [echo] B


In reading the online docs, it gave me the impression the atarget would 
not run:  "A target also has the ability to perform its execution if (or 
unless) a property has been set."

So, the question is - is depends taking precedence over unless?

Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-890-8117 (Work)

Chief Architect JPlate
Chief Architect JavaPIM

Architect Keros

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

This e-mail, including any attached files, may contain confidential and privileged information
for the sole use of the intended recipient.  Any review, use, distribution, or disclosure
by others is strictly prohibited.  If you are not the intended recipient (or authorized to
receive information for the intended recipient), please contact the sender by reply e-mail
and delete all copies of this message.

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

View raw message