summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Gemmell <robbie@apache.org>2012-01-06 14:07:42 +0000
committerRobert Gemmell <robbie@apache.org>2012-01-06 14:07:42 +0000
commit3d708233571b883789ca15aeea7003a8de7ce1f3 (patch)
treec19739fe5ceba75fb71dda5bfdc2d1cc19774f20
parent9d8a602cfc41a5c8d155507293c90e92f1457b52 (diff)
downloadqpid-python-3d708233571b883789ca15aeea7003a8de7ce1f3.tar.gz
QPID-3670: Add new build target to allow the Cobertura jar files to be downloaded automatically if not already present
Applied patch from Andrew MacBean <andymacbean@gmail.com> git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1228192 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/common.xml26
-rw-r--r--java/lib/cobertura/README.txt9
2 files changed, 28 insertions, 7 deletions
diff --git a/java/common.xml b/java/common.xml
index 26537e7dfc..4e9e2d1598 100644
--- a/java/common.xml
+++ b/java/common.xml
@@ -61,6 +61,12 @@
<property name="javac.compiler.args" value=""/>
<property name="cobertura.dir" value="${project.root}/lib/cobertura" />
+ <property name="cobertura.version" value="1.9.4.1" />
+ <property name="cobertura.download.url"
+ value="http://downloads.sourceforge.net/project/cobertura/cobertura/${cobertura.version}/cobertura-${cobertura.version}-bin.zip" />
+ <property name="cobertura.zip.filename" value="cobertura-${cobertura.version}-bin.zip" />
+ <property name="cobertura.temp.dir" value="${cobertura.dir}"/>
+
<property name="mllib.dir" value="${project.root}/../python" />
<property name="findbugs.dir" value="${project.root}/lib/findbugs" />
@@ -71,8 +77,8 @@
<path id="cobertura.classpath">
<fileset dir="${cobertura.dir}">
- <include name="cobertura.jar" />
- <include name="lib/**/*.jar" />
+ <include name="cobertura-${cobertura.version}/*.jar" />
+ <include name="cobertura-${cobertura.version}/**/lib/*.jar" />
</fileset>
</path>
@@ -192,6 +198,22 @@
<taskdef classpathref="cobertura.classpath" resource="tasks.properties" />
</target>
+ <!--download Cobertura jar and expand-->
+ <target name="download-cobertura" description="download Cobertura if not already present" depends="cobertura-check" unless="cobertura.already.exists">
+ <mkdir dir="${cobertura.dir}"/>
+ <echo>Downloading Cobertura ${cobertura.version}</echo>
+ <get src="${cobertura.download.url}" dest="${cobertura.temp.dir}/${cobertura.zip.filename}" usetimestamp="false" />
+ <echo>Extracting Cobertura JAR and dependencies</echo>
+ <unzip src="${cobertura.temp.dir}/${cobertura.zip.filename}" dest="${cobertura.dir}"/>
+ <echo>Cleanup Cobertura Download</echo>
+ <delete file="${cobertura.temp.dir}/${cobertura.zip.filename}"/>
+ <echo>Done</echo>
+ </target>
+
+ <target name="cobertura-check">
+ <available property="cobertura.already.exists" file="${cobertura.dir}/cobertura-${cobertura.version}" type="dir"/>
+ </target>
+
<target name="findbugs-init">
<available file="${findbugs.dir}/findbugs-ant.jar" property="findbugs-ant.jar.present"/>
<fail unless="findbugs-ant.jar.present" message="Please follow the instructions at ${findbugs.dir}/README.txt to configure FindBugs"/>
diff --git a/java/lib/cobertura/README.txt b/java/lib/cobertura/README.txt
index 8e4cc09a80..080bb5f2f3 100644
--- a/java/lib/cobertura/README.txt
+++ b/java/lib/cobertura/README.txt
@@ -1,10 +1,9 @@
-Download the cobertura binary from the following location:
+Download the cobertura binary from the following location and expand it into
+this directory.
http://cobertura.sourceforge.net/download.html
-
-Unpack it into the cobertura (this) directory with tar --strip-path 1 -xf.
-This should leave you with cobertura.jar in qpid/java/lib/cobertura.
+Alternatively run "ant download-cobertura" to do this automatically.
+(to set a http proxy for ant use ANT_OPTS="-Dhttp.proxyHost=<host> -Dhttp.proxyPort=<port>")
Run "ant cover-test coverage-report" to generate coverage report.
-