ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Price <>
Subject Re: How to handle conditional capabilities?
Date Mon, 31 Mar 2003 17:01:06 GMT

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?


View raw message