Douglas Kramer wrote:
I'd like to set up my Ant script to load one set of paths if I'm building on one machine and a different set of paths when building on a another machine.
this can be achieved in a variety of ways;
In build.properties I have:
run.classpath.javadoc="${JAVA_HOME}/lib/tools.jar" run.classpath.mifdoclet="${WORKDIR}/build/jar/mifdoclet.jar"
My script is:
<exec dir="${sample}/example-bookfile" executable="java">
<arg line="-classpath ${run.classpath.mifdoclet}:${run.classpath.javadoc}" />
<arg line="-Xmx20M" />
<arg line="com.sun.tools.javadoc.Main" />
<arg line="-doclet com.sun.tools.doclets.formats.mif.MIFDoclet" />
<arg line="-book book-solaris.xml" />
<arg line="-group 'Summary of Sample Packages' 'com.*'" />
<arg line="-sourcepath ../sample-src com.package1 com.package1.subpackage com.package2" />
</exec>
hmmm, may I suggest using the <java/> task instead of exec ?
<java classname="com.sun.tools.javadoc.Main" fork="true" failonerror="true" maxmemory="128m" > <arg line="-doclet com.sun.tools.doclets.formats.mif.MIFDoclet" /> <arg line="-book book-solaris.xml" /> <arg line="-group 'Summary of Sample Packages' 'com.*'" /> <arg line="-sourcepath ../sample-src com.package1 com.package1.subpackage com.package2" /> <classpath> <pathelement location="${run.classpath.mifdoclet}"/> <pathelement location="${run.classpath.javadoc}"/> </classpath> </java>
I assume that the things that are changing are your classpaths?
you know you can define reusable classpaths
<path id="myclasspath"> <pathelement location="${run.classpath.mifdoclet}"/> <pathelement location="${run.classpath.javadoc}"/> </path>
which can then be refered to by <java/> classpathref attribute
<java classname="com.sun.tools.javadoc.Main" fork="true" failonerror="true" maxmemory="128m" classpathref="myclasspath" > <arg line="-doclet com.sun.tools.doclets.formats.mif.MIFDoclet" /> <arg line="-book book-solaris.xml" /> <arg line="-group 'Summary of Sample Packages' 'com.*'" /> <arg line="-sourcepath ../sample-src com.package1 com.package1.subpackage com.package2" /> </java>
user.home User's home directory
user.dir User's current working directory
How would I set up the condition, please?
not sure exactly what you want....have u seen <condition/> ? you know you could just supply different property files...
gl, Jim Fuller
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]