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...

Reply via email to