summaryrefslogtreecommitdiffstats
path: root/sca-java-1.x/branches
diff options
context:
space:
mode:
authornash <nash@13f79535-47bb-0310-9956-ffa450edef68>2010-05-16 22:37:56 +0000
committernash <nash@13f79535-47bb-0310-9956-ffa450edef68>2010-05-16 22:37:56 +0000
commit5491301f312e6f316ce7678ad6b2209d0b126fa7 (patch)
tree794cdb320292376f0370480b316a822e068cce14 /sca-java-1.x/branches
parent6017d28640e5df6018e80f246cc9b4fe7a3f1914 (diff)
Restore package-path setting previously removed under r931717 (TUSCANY-3412)
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@944931 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-1.x/branches')
-rw-r--r--sca-java-1.x/branches/sca-java-travelsample-1.0/antdefs.xml31
1 files changed, 31 insertions, 0 deletions
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/antdefs.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/antdefs.xml
index 163e82452a..c0a6e3ff9c 100644
--- a/sca-java-1.x/branches/sca-java-travelsample-1.0/antdefs.xml
+++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/antdefs.xml
@@ -65,6 +65,8 @@
"package" Creates a jar file containing the compiled Java class
files (excluding unit test code) and any files in or under the
resource directory, unless the jar file is already up to date.
+ If the build.xml file defines a path with id "package-path", this
+ path is used for the Class-Path manifest entry.
"clean" Deletes all the files produced by the build.
This file also defines the following targets for invocation by <antcall>
@@ -613,10 +615,39 @@
<!-- build a jar file if there are no files in the webapp directory -->
<target name="#package-jar" unless="#webapp">
+ <antcall target="#create-jar"/>
+ </target>
+
+ <!-- check whether a dependency path for the package target was specified -->
+ <target name="#check-package-path">
+ <condition property="#package-path">
+ <isreference refid="package-path"/>
+ </condition>
+ </target>
+
+ <!-- create a jar file with a Class-Path attribute -->
+ <target name="#create-jar-path" if="#package-path">
+ <property name="#parentdir" location=".."/>
+ <pathconvert property="#package-classpath" refid="package-path" pathsep=" " dirsep="/">
+ <map from="${#parentdir}" to=".."/>
+ </pathconvert>
+ <jar destfile="target/${ant.project.name}.jar" basedir="target/classes"
+ excludes="**/*.cbp">
+ <manifest>
+ <attribute name="Class-Path" value="${#package-classpath}"/>
+ </manifest>
+ </jar>
+ </target>
+
+ <!-- create a jar file without a Class-Path attribute -->
+ <target name="#create-jar-nopath" unless="#package-path">
<jar destfile="target/${ant.project.name}.jar" basedir="target/classes"
excludes="**/*.cbp"/>
</target>
+ <!-- create a jar file with or without a Class-Path attribute -->
+ <target name="#create-jar" depends="#check-package-path, #create-jar-path, #create-jar-nopath"/>
+
<!-- build a packaged jar file or war file -->
<target name="#build-package" depends="#check-webapp, #package-war, #package-jar"/>