ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Adams" <>
Subject RE: Target/unless not working
Date Thu, 01 Aug 2002 22:34:43 GMT
It does, very clear, thanks.

But, is there a way around this? I have projects that depend on other
projects being built. But I would like to not have to build core
projects over and over again as that will make the process too iterative
and long.

What would you suggest?

-----Original Message-----
From: Dominique Devienne []
Sent: Thursday, August 01, 2002 5:22 PM
To: 'Ant Users List'
Subject: RE: Target/unless not working

Nope! Because each <antcall> defines a new Project, and properties set
that 'child' project (created by <antcall>) are not visible to the
project. That's the way <antcall> works. Properties percolate down
inheritAll='false'; or is that just an <ant> attribute?), but never up.

So <antcall target="first"/> doesn't really set the "first_built"
it sets the "antcall#1:first_built" property, which is not visible to
<antcall target="second"/> (which sets "antcall#2:first_built" when it
the 'first' target). Neither this properties would be visible if you
to <echo> them in your main target after the 2 antcalls...

Hope this help clarify things a bit. --DD

-----Original Message-----
From: David Adams [] 
Sent: Thursday, August 01, 2002 5:14 PM
Subject: Target/unless not working

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 name="first" depends="init" unless="first_built">
		<echo message="first"/>
		<property name="first_built" value="true"/>
		<echo message="${first_built}"/>


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

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

My output is:

     [echo] init

     [echo] first
     [echo] true

     [echo] init

     [echo] first
     [echo] true

     [echo] true

Total time: 9 seconds

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


David Adams
Ignite Sports (
Voice: 773.293.4300

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

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

View raw message