ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Duffey, Kevin" <>
Subject RE: How to handle conditional capabilities?
Date Mon, 31 Mar 2003 17:05:45 GMT
That would almost work, except that I want to do this in one build.xml file in complete, rather
than space it out over a few. It's a small project and I can't see having so many build files.
I just wanted to have a single build with several targets and depending on conditions (usually
set by parameters passed in), I would be able to make, build, package and/or deploy the project.


-----Original Message-----
From: Erik Price [] 
Sent: Monday, March 31, 2003 9:01 AM
To: Ant Users List
Subject: Re: How to handle conditional capabilities?

Duffey, Kevin wrote:
> Hi Erik,
> That sounds pretty close. Ideally, in a programmatic way I would have each little piece
in its own separate module, then call them however I wish, assembling the final "build" process
in a custom manner. For example, a target for make and build, where make would simply compile
classes and package up .jar files as necessary, but build would delete all compiled classes,
jar files, then do a full compile, then package up everything. I'd almost see it as a hierarchy
of targets. The default target is the one that "controls" everything, and always runs. Ideally
I'd like to be able to do something like:
> if (build)
> {
>   <antcall target="init"/>
>   <antcall target="clean"/>
>   <antcall target="compile"/>
>   <antcall target="build"/>
>   <antcall target="package"/>
>   <antcall target="deploy"/>
> }
> else if (make)
> {
>   <antcall target="compile"/>
>   <antcall target="package"/>
> }

It *seems* (if I understand) like you could achieve this by creating a 
"build" target which simply depends on all the aforementioned targets, 
likewise with a "make" target.
Use the <target depends="init,clean,compile,etc"> tag to do this.

Personally, I have a similar setup where my "test" target depends on 
"build" which depends on "prepare", and I generally do my development 
with this command:

ant clean test

Which first cleans the directory and then runs "prepare" target, "build" 
target, and then "test" target.

Maybe this is helpful?


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

Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (
Version: 6.0.463 / Virus Database: 262 - Release Date: 3/17/2003

Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
Version: 6.0.463 / Virus Database: 262 - Release Date: 3/17/2003

The information contained in this e-mail message may be 
confidential and  protected from disclosure. If you are 
not the intended recipient, any dissemination, distribution
or copying is strictly prohibited. If you think that you 
have received this e-mail message in error,
please e-mail the sender at

View raw message