ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Goodnough" <>
Subject Re: Building from a list...
Date Tue, 25 Apr 2006 16:43:06 GMT
>>> On Tue, Apr 25, 2006 at 11:13 am, in message
<>, "Andrew
<> wrote: 
> hello,
> i'm having a bit of a brain- fart coming up with a solution to this
> situation.  we have about 130 JAR files that we are building for a
> particular project.  most of these JARs are dependent on each other
> they require a specific build order.  i was hoping to create a list
> the projects that compose each JAR and feed this list to ANT to
> one at a time.  i know the Ant- Contrib project has a <foreach> tag
> that allows for iteration, but i'm a bit stumped on how to build
> everything from a properties file.  is this possible?  or is there a
> better way to approach this?
> we're using VSS as source control and have several projects that are
> composed of several (130+) products/JARs in VSS.  so i'd like to
> a list of Project.Product that i can iterate through and
> build/JAR/deploy in order.
> so in VSS we may have Project1 that contains ProductA, ProductB &
> ProductC and Project2 that contains ProductD & ProductE and Project3
> that contains ProductF, ProductG & ProductH.  the build order may
> up being:
> ProductB, ProductG, ProductA, ProductC, ProductD, ProductF,
> so my initial idea was to create a master list that contains these
> products in their proper build order:
> Project1.ProductB
> Project3.ProductG
> Project1.ProductA
> Project1.ProductC
> Project2.ProductD
> Project3.ProductF
> Project2.ProductE
> our ANT build file is currently set up to build products
>  so typically we'd pass in the ProjectName, ProductName, Branch,
> DeliverableType and DeploymentDest to build one product/JAR/etc.  to
> build all applications (build world) we have to either type this in
> manually 130+ times or we use a .bat file that makes 130+ calls. 
> problem with the .bat file is that if product 15 fails a bunch of
> builds that follow will fail due to dependency.  there is no good
> to stop the build process on error.  so i was hoping ANT would be
> to come to the rescue. :)
> hopefully this is enough background to either come up with a
> or generate some discussion that will lead to a solution.
> thanks for any help you can offer.
> To unsubscribe, e- mail: user-
> For additional commands, e- mail: user-

We have a large amount of projects with interdependencies, too.  Our
process sets up a set of files (with pre-defined names) which allow the
project owner to configure dependencies, including triggering
sub-builds, in any.  First, here's how the classpath is setup for the
compile.  The "includesfile" property includes from the files.  

  <path id="project.class.path">
    <dirset dir=".." includesfile="${classes.depend.file}"/>
    <fileset dir="${lib.dir}" includesfile="${jars.depend.file}"/>
    <fileset dir="${sharedlib.dir}"

A typical jars.depend file looks like this:




Second, if in addition to including the classes from Global-Utils and
Parent-Proj, you want this project to build both projects before
building itself, then have your compile target depend on sub-compile
target like:

  <target name="compile-subprojects">
    <subant target="compile">
      <dirset dir=".." includesfile="${projects.depend.file}"/>

  <target name="compile" depends="init,compile-subprojects"
description="Compiles the source files">
    <javac srcdir="${src.dir}"
        <classpath refid="project.class.path"/>

where you put the 2 projects in the projects.depend:


Each project must have standard target names to use this scheme, but it
scales well.  We use Entity references to gain a type of inheritance in
Ant to reuse common targets but that's another topic.  Good luck!


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

View raw message