ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <>
Subject RE: using property in target depends
Date Tue, 27 Aug 2002 15:40:47 GMT
Ant must analyze the dependency graph of all the targets to know in which
order to run them, to not run them twice, and find cycles that would throw
it into an infinite loop. This is a static analysis that happens at build
file load time. Having this analysis depend on property expansion, itself
depending on executing tasks/types at runtime, is at least impractical, if
possible at all.

Use <antcall> instead to call a target based on a property. You pay for the
new Ant Project created though. Or use the newly submitted <antrun> patch
from Nicola Ken Barozzi that is equivalent to <antcall>, but faster, with a
few caveats. --DD

-----Original Message-----
From: David Adams [] 
Sent: Tuesday, August 27, 2002 10:32 AM
Subject: using property in target depends

I was looking to control a project flow by putting in a property value
dynamically into the depends attribute of the target tag. 

For example, I wanted to do the following:
	<target name="main" depends="${build.type}"/>

	<target name="dev"

	<target name="test" depends="prepare,compile,test.suite"/>

	<target name="prod"

where build.type would be either dev, test, or prod, defaulting to dev in a
properties file and configurable through the command line. 

I run into a problem with this, but it is not clear to me what the issue is.
When running, I receive:
Target `${build.type}' does not exist in this project. It is used from
target `main'.

I feel that I am missing something fundamental here....


David Adams
Ignite Sports (
Voice: 773.293.4300

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

View raw message