ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Adams" <DAd...@ignitesports.com>
Subject Target/unless not working
Date Thu, 01 Aug 2002 22:14:24 GMT
I am attempting to manage build dependencies by setting a property in a target and then filtering
on that property using "unless", which should avoid running that target since the property
was set. 

Below is an example of the code I am trying:
<project name="masterbuild" default="main" basedir=".">
	<target name="init">
		<echo message="init"/>
	</target>

	<target name="first" depends="init" unless="first_built">
		<echo message="first"/>
		<property name="first_built" value="true"/>
		<echo message="${first_built}"/>

	</target>

	<target name="second" unless="second_built" depends="first">
		<echo message="${first_built}"/>
		<property name="second_built" value="true"/>

	</target>
	
	<target name="main">
		<antcall target="first"/>
		<antcall target="second"/>
	</target>
    
</project>

My output is:
main:

init:
     [echo] init

first:
     [echo] first
     [echo] true

init:
     [echo] init

first:
     [echo] first
     [echo] true

second:
     [echo] true

BUILD SUCCESSFUL
Total time: 9 seconds

The expectation is that "second" runs without going into "first".

Thoughts?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
David Adams
Ignite Sports (www.ignitesports.com)
Voice: 773.293.4300
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message