ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scot P. Floess" <>
Subject Target unless question
Date Thu, 13 Aug 2009 19:09:11 GMT

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:

View raw message