ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject AW: depends on files instead of targets
Date Wed, 25 Jun 2003 05:10:33 GMT
> Basically I'm looking for the top level build.xml file to 
> just read the
> entire build tree and figure out everything that needs to be 
> built and then
> just do it while having a build.xml file in each dir so 
> developers can build
> one bin at a time when needed.

Sounds that <subant> could some work here.

> I understand how to make a target dependent upon another 
> target and how to
> have the target dependent upon the src files in a dir tree ( 
> uptodate ) but
> now I want to have a target ( exe ) be dependent upon another 
> target in a
> different build file ( dll ) 
> Which is the better way to do this?
> 1. have a file set list of dependent dll files for the exe 
> target, but then
> I need a build rule for that dependent target.

If you have a list you can use AntContribs <foreach> for iterating
over the files and call the targets.

<target name="compile">
    <foreach target="doCompile" param="buildfile">
        <path><fileset dir="." includes="**/build.xml"
<target name="doCompile">
        <try> <ant buildfile="${buildfile}" target="compile"/> </try>
        <catch> <echo> target 'compile' does not exist in
${buildfile}</echo> </catch>

> 2. is there a way to set depends= for a file instead of a 
> target name.?

- depend on a target that checks preconditions and sets a flag
- the target has a if-clause
<target name="x" depends="x.cond" if="x.cond">
    <echo>x.cond is set</echo>
<target name=x.cond">
    <condition property="x.cond"> <itsNotRainingToday/> </condition>

> 3. include the other build files in the proper order all the 
> time and have
> them build themselves as needed.

Disadvantage: multiple target names in multiple files could make some
errors here. I donĀ“t know whether <import> can handle these.

> 4. ????

Maybe <subant>


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message