ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Judy Sowell <jsow...@avolent.com>
Subject RE: Building multiple targets using the <ant> task?
Date Thu, 15 Nov 2001 22:56:43 GMT
I understand that there is an optional (but not yet official) task called
"foreach", which you might be able to use with your list of targets from
your ${build.targetlist} and then do antcall on each one. Take a look at the
archives for examples. I have never used it, so I'll leave that for the Ant
veterans out there. 

-----Original Message-----
From: Bryan Pendleton [mailto:bpendleton@edgility.com]
Sent: Thursday, November 15, 2001 12:21 PM
To: 'Ant Users List'
Subject: RE: Building multiple targets using the <ant> task?


Thanks for the suggestions. Those both work, but
in my case, the actual set of targets is not
pre-determined; I was hoping to be able to pass the
set of targets in at runtime (for example, by
loading them from a property file).

That is, I'd like to have something like:
<project name="masterBuild">
  <property file="master.cfg"/>
  <ant antfile="${build.buildFile}" 
       target="${build.targetlist}"/>
</project>

where master.cfg might contain

build.buildFile=subProj/build.xml
build.targetList=clean build test1 test2

Is there an elegant way to do this?

thanks,

bryan

> -----Original Message-----
> From: Peter Davis [mailto:peter@speaklink.com] 
> Sent: Thursday, November 15, 2001 12:07 PM
> To: Ant Users List
> Subject: Re: Building multiple targets using the <ant> task?
> 
> 
> I think the simple solution is to simply do
> 
> <ant target="clean"/>
> <ant target="build"/>
> <ant target="test1"/>
> <ant target="test2"/>
> 
> 
> Or, you could make an empty target that only has depends:
> 
> <target name="doStuff" depends="clean build test1 test2"/>
> 
> and then do
> <ant target="doStuff"/>
> 
> Bryan Pendleton wrote:
> 
> >When I run ant from the command line, I can say
> >
> >  ant clean build test1 test2
> >
> >and that single invocation of ant will figure out
> >all the task dependencies and build all the named
> >targets, in one single clean pass.
> >
> >Can I do the same thing using the <ant> task? I
> >tried the obvious
> >
> >  <ant target="clean build test1 test2"/>
> >
> >and ant responded with
> >
> >  Target 'clean build test1 test2' does not exist in this project.
> >
> >thanks,
> >
> >bryan
> >
> >mailto:Bryan.Pendleton@edgility.com
> >
> >
> >--
> >To unsubscribe, e-mail:   
> <mailto:ant-user-> unsubscribe@jakarta.apache.org>
> >For 
> additional commands, 
> e-mail: 
> ><mailto:ant-user-help@jakarta.apache.org>
> >
> >
> >
> 
> -- 
> Furthermore, I believe bacon prevents hair loss.
> 
> Peter Davis
> Developer, Speaklink Inc.
> peter@speaklink.com
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:ant-user-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <mailto:ant-user-help@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message