The "download" target in build.xml seemed kind of ugly, duplicating
the filenames in both the urls and destinations because the <get> task
can't be told to drop files in a directory, and cluttering up
build.xml with giant urls. So, I pulled the urls and filenames out
into a properties file and made the <get> tasks use them instead of
hardcoding things. At the very least it removes some duplication in
the filenames and cleans things up a little bit.
Still on the TODO list is making download run automatically if any of
the dependencies aren't present...
-garrett
[[[
Pull urls and filenames out of build.xml into a properties file.
* build/build.xml
Pull properties from dependencies/deps.properties.
(download): Use new properties.
* dependencies/deps.properties: New file.
]]]
Index: build/build.xml
===================================================================
--- build/build.xml (revision 414915)
+++ build/build.xml (working copy)
@@ -27,7 +27,10 @@
<property name="parser.test" value="${parser}/src/test/java" />
<property name="parser.work" value="${work}/parser" />
<property name="parser.jar"
value="${dist}/${ant.project.name}.parser.${version}.jar" />
+
<property name="dependencies" value="${basedir}/dependencies" />
+ <property file="${dependencies}/deps.properties" />
+
<path id="jar.dependencies">
<fileset dir="${dependencies}" includes="**/*.jar" />
</path>
@@ -122,34 +125,47 @@
</target>
<target name="download" depends="init">
- <echo>Downloading project dependencies.. this may take a moment</echo>
+ <echo>Downloading project dependencies. This may take a moment</echo>
<parallel>
- <get
src="http://www.apache.org/dist/java-repository/org.apache.geronimo.specs/jars/geronimo-activation_1.0.2_spec-1.0.jar"
- dest="${dependencies}/geronimo-activation_1.0.2_spec-1.0.jar"
usetimestamp="true" />
- <get
src="http://www.apache.org/dist/java-repository/org.apache.geronimo.specs/jars/geronimo-javamail_1.3.1_spec-1.0.jar"
- dest="${dependencies}/geronimo-javamail_1.3.1_spec-1.0.jar"
usetimestamp="true" />
- <get
src="http://www.apache.org/dist/java-repository/ws-commons/jars/axiom-api-1.0.jar"
- dest="${dependencies}/axiom-api-1.0.jar" usetimestamp="true" />
- <get
src="http://www.apache.org/dist/java-repository/ws-commons/jars/axiom-impl-1.0.jar"
- dest="${dependencies}/axiom-impl-1.0.jar" usetimestamp="true" />
- <get src="http://dist.codehaus.org/jaxen/jars/jaxen-1.1-beta-7.jar"
- dest="${dependencies}/jaxen-1.1-beta-7.jar" usetimestamp="true" />
- <get
src="http://www.apache.org/dist/java-repository/log4j/jars/log4j-1.2.12.jar"
- dest="${dependencies}/log4j-1.2.12.jar" usetimestamp="true" />
- <get src="http://dist.codehaus.org/stax/jars/stax-1.1.2-dev.jar"
- dest="${dependencies}/stax-1.1.2-dev.jar" usetimestamp="true" />
- <get src="http://dist.codehaus.org/stax/jars/stax-api-1.0.jar"
- dest="${dependencies}/stax-api-1.0.jar" usetimestamp="true" />
- <get
src="http://www.apache.org/dist/java-repository/commons-logging/jars/commons-logging-1.0.4.jar"
- dest="${dependencies}/commons-logging-1.0.4.jar" usetimestamp="true"
/>
- <get
src="http://www.apache.org/dist/java-repository/commons-codec/jars/commons-codec-1.3.jar"
- dest="${dependencies}/commons-codec-1.3.jar" usetimestamp="true" />
- <get
src="http://www.apache.org/dist/java-repository/commons-httpclient/jars/commons-httpclient-3.0.1.jar"
- dest="${dependencies}/commons-httpclient-3.0.1.jar"
usetimestamp="true" />
- <get src="http://www.ibiblio.org/maven/junit/jars/junit-3.8.1.jar"
- dest="${dependencies}/junit-3.8.1.jar" usetimestamp="true" />
- <get src="http://woodstox.codehaus.org/2.0.5/wstx-asl-2.0.5.jar"
- dest="${dependencies}/wstx-asl-2.0.5.jar" usetimestamp="true" />
+ <get src="${geronimo.activation.dir}/${geronimo.activation.jar}"
+ dest="${dependencies}/${geronimo.activation.jar}"
+ usetimestamp="true" />
+ <get src="${geronimo.javamail.dir}/${geronimo.javamail.jar}"
+ dest="${dependencies}/${geronimo.javamail.jar}"
+ usetimestamp="true" />
+ <get src="${axiom.dir}/${axiom.api.jar}"
+ dest="${dependencies}/${axiom.api.jar}"
+ usetimestamp="true" />
+ <get src="${axiom.dir}/${axiom.impl.jar}"
+ dest="${dependencies}/${axiom.impl.jar}"
+ usetimestamp="true" />
+ <get src="${jaxen.dir}/${jaxen.jar}"
+ dest="${dependencies}/${jaxen.jar}"
+ usetimestamp="true" />
+ <get src="${log4j.dir}/${log4j.jar}"
+ dest="${dependencies}/${log4j.jar}"
+ usetimestamp="true" />
+ <get src="${stax.dir}/${stax.jar}"
+ dest="${dependencies}/${stax.jar}"
+ usetimestamp="true" />
+ <get src="${stax.dir}/${stax.api.jar}"
+ dest="${dependencies}/${stax.api.jar}"
+ usetimestamp="true" />
+ <get src="${commons.logging.dir}/${commons.logging.jar}"
+ dest="${dependencies}/${commons.logging.jar}"
+ usetimestamp="true" />
+ <get src="${commons.codec.dir}/${commons.codec.jar}"
+ dest="${dependencies}/${commons.codec.jar}"
+ usetimestamp="true" />
+ <get src="${commons.httpclient.dir}/${commons.httpclient.jar}"
+ dest="${dependencies}/${commons.httpclient.jar}"
+ usetimestamp="true" />
+ <get src="${junit.dir}/${junit.jar}"
+ dest="${dependencies}/${junit.jar}"
+ usetimestamp="true" />
+ <get src="${wstx.dir}/${wstx.jar}"
+ dest="${dependencies}/${wstx.jar}"
+ usetimestamp="true" />
</parallel>
</target>
Index: dependencies/deps.properties
===================================================================
--- dependencies/deps.properties (revision 0)
+++ dependencies/deps.properties (revision 0)
@@ -0,0 +1,34 @@
+geronimo.activation.dir=http://www.apache.org/dist/java-repository/org.apache.geronimo.specs/jars
+geronimo.activation.jar=geronimo-activation_1.0.2_spec-1.0.jar
+
+geronimo.javamail.dir=http://www.apache.org/dist/java-repository/org.apache.geronimo.specs/jars
+geronimo.javamail.jar=geronimo-javamail_1.3.1_spec-1.0.jar
+
+axiom.dir=http://www.apache.org/dist/java-repository/ws-commons/jars
+axiom.api.jar=axiom-api-1.0.jar
+axiom.impl.jar=axiom-impl-1.0.jar
+
+jaxen.dir=http://dist.codehaus.org/jaxen/jars
+jaxen.jar=jaxen-1.1-beta-7.jar
+
+log4j.dir=http://www.apache.org/dist/java-repository/log4j/jars
+log4j.jar=log4j-1.2.12.jar
+
+stax.dir=http://dist.codehaus.org/stax/jars
+stax.jar=stax-1.1.2-dev.jar
+stax.api.jar=stax-api-1.0.jar
+
+commons.logging.dir=http://www.apache.org/dist/java-repository/commons-logging/jars
+commons.logging.jar=commons-logging-1.0.4.jar
+
+commons.codec.dir=http://www.apache.org/dist/java-repository/commons-codec/jars
+commons.codec.jar=commons-codec-1.3.jar
+
+commons.httpclient.dir=http://www.apache.org/dist/java-repository/commons-httpclient/jars
+commons.httpclient.jar=commons-httpclient-3.0.1.jar
+
+junit.dir=http://www.ibiblio.org/maven/junit/jars
+junit.jar=junit-3.8.1.jar
+
+wstx.dir=http://woodstox.codehaus.org/2.0.5
+wstx.jar=wstx-asl-2.0.5.jar