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:
http://www.nabble.com/ANT-enhancements-td24028826.html --- Shawn Castrianni -----Original Message----- From: Scot P. Floess [mailto:[email protected]] Sent: Thursday, August 13, 2009 2:09 PM To: [email protected] Subject: Target unless question All: 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> <target name="B"> <echo message = "B"/> </target> <target name="C" unless = "stop" depends="A, B"/> </project> When I run as either: ant -Dstop="true" -or- ant -Dstop=true I get the following results: Buildfile: build.xml A: [echo] A B: [echo] B C: 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 http://sourceforge.net/projects/jplate Chief Architect JavaPIM http://sourceforge.net/projects/javapim Architect Keros http://sourceforge.net/projects/keros --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] ---------------------------------------------------------------------- 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: [email protected] For additional commands, e-mail: [email protected]
