I have an buildfile with a target for compiling, building EJBs and building jar files. Multiple developers work on my project, so we set a property, project.dir, to be "base" directory. All other directories are in relation to that (as properties), e.g.
<property name="src" value="${project.dir}/src"/>
<property name="build" value="${project.dir}/build"/>
<property name="docroot" value="${build}/public_html"/>
<target name="build" ...>
<!-- build the code in ${src} -->
<!-- put the class files in ${build} -->
When we do a build for a release, Ant checks out a version of the source from CVS into a temp dir and builds the application. So, from the command line I can override the "project.dir" with "-Dproject.dir=/tmp" (assuming I have CVS checkout the code to "/tmp". This is fine, but I'd like to be able to do is create another target, say "production" and have IT override/redefine "project.dir" and call the necessary targets:
<target name="production">
<antcall target="build">
<param name="project.dir" value="/tmp"/>
...
This doesn't work. I'd be willing to redefine the properties in the antcall, but that doesn't seem to work either:
<target name="production">
<antcall target="build">
<param name="project.dir" value="/tmp"/>
<param name="src" value="${project.dir}/src" />
<param name="build" value="${project.dir}/build" />
...
I think I understand why this doesn't work, but I'm still confused... What alternatives do I have?
---
Ralph Churchill
