commit f31e65829dc570a6283895cab77bade6cda2fa83 Author: iwakeh iwakeh@torproject.org Date: Wed Jan 4 12:58:10 2017 +0100
Corrected source-jar contents, enabled additonal target execution before signing using a new property, and cleaned up jar-task. --- java/base.xml | 33 ++++++++++++++++++++++----------- java/build.xml.template | 5 +++++ 2 files changed, 27 insertions(+), 11 deletions(-)
diff --git a/java/base.xml b/java/base.xml index 0658cdb..5899ec2 100644 --- a/java/base.xml +++ b/java/base.xml @@ -28,6 +28,7 @@ value="${dist}/${name}-${release.version}.tar.gz" /> <property file="build.properties" /> <property name="emptymanifest" value="${generated}/emptymanifest" /> + <property name="tardepends" value="" />
<!-- generic path definitions --> <path id="classpath"> @@ -242,22 +243,28 @@ </condition> <antcall target="jarring" > <param name="destfile" value="${dist}/${jarfile}" /> - <param name="usepath" value="${libs}" /> - <param name="usepattern" value="${jarpattern}" /> <param name="usebase" value="${classes}" /> + <param name="usepath" value="${sources}" /> + <param name="usepattern" value="empty" /> + <param name="uselibpath" value="${libs}" /> + <param name="uselibpattern" value="${jarpattern}" /> </antcall> <property name="manifestfile" value="${emptymanifest}" /> <antcall target="jarring" > <param name="destfile" value="${dist}/${jarsourcesfile}" /> - <param name="usepath" value="${libs}" /> - <param name="usepattern" value="empty" /> - <param name="usebase" value="${basedir}/src" /> + <param name="usebase" value="${testsources}" /> + <param name="usepath" value="${sources}" /> + <param name="usepattern" value="**/*.java" /> + <param name="uselibpath" value="${libs}" /> + <param name="uselibpattern" value="empty" /> </antcall> <antcall target="jarring" > <param name="destfile" value="${dist}/${jardocsfile}" /> - <param name="usepath" value="${libs}" /> - <param name="usepattern" value="empty" /> <param name="usebase" value="${docs}" /> + <param name="usepath" value="${docs}" /> + <param name="usepattern" value="*" /> + <param name="uselibpath" value="${libs}" /> + <param name="uselibpattern" value="empty" /> </antcall> </target>
@@ -272,13 +279,13 @@ </not> <archives> <zips> - <fileset dir="${usepath}"> - <patternset refid="${usepattern}" /> + <fileset dir="${uselibpath}"> + <patternset refid="${uselibpattern}" /> </fileset> </zips> </archives> </restrict> - + <fileset dir="${usepath}" includes="${usepattern}" /> <manifest> <attribute name="Created-By" value="The Tor Project" /> <attribute name="Implementation-Title" value="${implementation-title}"/> @@ -288,7 +295,7 @@ </jar> </target>
- <target name="signall" depends="jar"> + <target name="signall" depends="other,jar"> <condition property="tobesigned" value="${jarfile} ${jarsourcesfile} ${jardocsfile} ${additional2sign}" else="${jarfile} ${jarsourcesfile} ${jardocsfile}" > @@ -326,6 +333,10 @@
</target>
+ <target name="other" if="tardepends" > + <antcall target="${tardepends}" /> + </target> + <target name="tar" depends="signall"> <tar destfile="${release.tarball}" compression="gzip"> <tarfileset dir="." prefix="${name}-${release.version}"> diff --git a/java/build.xml.template b/java/build.xml.template index 7c29704..cdc5582 100644 --- a/java/build.xml.template +++ b/java/build.xml.template @@ -16,6 +16,11 @@ Remove, if this project uses the java version defined in base.xml <property name="source-and-target-java-version" value="1.7" /> --> + <!-- XXXX If the distribution target 'tar' depends on another task, + set this property, otherwise remove. + The named task will be executed before signing. + <property name="tardepends" value="XXXX" /> + -->
<!-- Name to appear in jar names etc. --> <property name="name" value="XXXX"/>