Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
ideas for building a list of projects

ideas for building a list of projects

2005-05-20       - By Mark Lybarger
Reply:     1     2  

we have 10 or so web projects, each with their own build.xml, and one main
builder project that builds all projects. the main build project explicitly
specifies the deployment components, and the projects to build such as:

<target name="distclean">
<delete dir="project1" quiet="${deletevoice}"/>
<delete dir="project2" quiet="${deletevoice}"/>
<delete dir="project3" quiet="${deletevoice}"/>
</target>

<target name="build">
<subant target="">
<filelist id="project-builds" dir="${subbuild.basedir}">
<file name="project1/build.xml"/>
<file name="project2/build.xml"/>
<file name="project3/build.xml"/>
</filelist>
</subant>
</target>

<target name="deploy">
<copy file="project1/project1.ear" todir="${deploy.dir}" />
<copy file="project2/project2.ear" todir="${deploy.dir}" />
<copy file="project3/project3.ear" todir="${deploy.dir}" />
</target>

it's not very clean certainly, as adding a new project is a lot of work, and
if a developer doesn't want to deploy all 10 projects they have to also hack
up the main build.xml. what it would be nice to do is to specify a list of
project names and project deployment items outside of the build.xml in a
property file perhaps that the developer could easily customize. is this
possible in ant? or any other suggestions? the build must be in a particular
order, so we can't use a wildcard in the build filelist, and also developers
can have mulitple directories for each project say project1-VERSION1,
project1-version2, etc. thus wildcarding on the deployment components is out
as well...

©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.