summaryrefslogtreecommitdiffstats
path: root/sca-java-1.x/trunk/tutorials/travelsample/antdefs.xml
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-1.x/trunk/tutorials/travelsample/antdefs.xml')
-rw-r--r--sca-java-1.x/trunk/tutorials/travelsample/antdefs.xml136
1 files changed, 129 insertions, 7 deletions
diff --git a/sca-java-1.x/trunk/tutorials/travelsample/antdefs.xml b/sca-java-1.x/trunk/tutorials/travelsample/antdefs.xml
index 9d918970d0..5b5a4efb67 100644
--- a/sca-java-1.x/trunk/tutorials/travelsample/antdefs.xml
+++ b/sca-java-1.x/trunk/tutorials/travelsample/antdefs.xml
@@ -87,6 +87,8 @@
. <idlfile> the filename of the IDL file
. <javaclass> the filename of any Java class file that will be
generated by running this target for this IDL file
+ "add-implementation-web" Adds implementation.web support to the
+ installed Tuscany SCA binary distribution if not already there.
All other targets defined by this file (with names starting with "#")
are for internal use within this file and should not be used externally.
@@ -397,6 +399,130 @@
</junit>
</target>
+ <!-- check whether the Tuscany SCA version is 1.5.1 -->
+ <target name="#find-tuscany-1.5.1">
+ <fileset id="#tuscany-assembly-1.5.1" dir="${env.TUSCANY_HOME}/modules">
+ <include name="tuscany-assembly-1.5.1.jar"/>
+ </fileset>
+ <condition property="#tuscany-version" value="1.5.1">
+ <resourcecount refid="#tuscany-assembly-1.5.1" when="greater" count="0"/>
+ </condition>
+ <condition property="#tuscany-repo" value="m2-ibiblio-rsync-repository">
+ <resourcecount refid="#tuscany-assembly-1.5.1" when="greater" count="0"/>
+ </condition>
+ </target>
+
+ <!-- check whether the Tuscany SCA version is 1.6-SNAPSHOT -->
+ <target name="#find-tuscany-1.6-SNAPSHOT" unless="#tuscany-version">
+ <fileset id="#tuscany-assembly-1.6-SNAPSHOT" dir="${env.TUSCANY_HOME}/modules">
+ <include name="tuscany-assembly-1.6-SNAPSHOT.jar"/>
+ </fileset>
+ <condition property="#tuscany-version" value="1.6-SNAPSHOT">
+ <resourcecount refid="#tuscany-assembly-1.6-SNAPSHOT" when="greater" count="0"/>
+ </condition>
+ <condition property="#tuscany-baseversion" value="1.6">
+ <resourcecount refid="#tuscany-assembly-1.6-SNAPSHOT" when="greater" count="0"/>
+ </condition>
+ <condition property="#tuscany-repo" value="m2-snapshot-repository">
+ <resourcecount refid="#tuscany-assembly-1.6-SNAPSHOT" when="greater" count="0"/>
+ </condition>
+ </target>
+
+ <!-- check whether the Tuscany SCA version is 1.6 -->
+ <target name="#find-tuscany-1.6" unless="#tuscany-version">
+ <fileset id="#tuscany-assembly-1.6" dir="${env.TUSCANY_HOME}/modules">
+ <include name="tuscany-assembly-1.6.jar"/>
+ </fileset>
+ <condition property="#tuscany-version" value="1.6">
+ <resourcecount refid="#tuscany-assembly-1.6" when="greater" count="0"/>
+ </condition>
+ <condition property="#tuscany-repo" value="m2-ibiblio-rsync-repository">
+ <resourcecount refid="#tuscany-assembly-1.6" when="greater" count="0"/>
+ </condition>
+ </target>
+
+ <!-- check whether the Tuscany SCA version is 1.7-SNAPSHOT -->
+ <target name="#find-tuscany-1.7-SNAPSHOT" unless="#tuscany-version">
+ <fileset id="#tuscany-assembly-1.7-SNAPSHOT" dir="${env.TUSCANY_HOME}/modules">
+ <include name="tuscany-assembly-1.7-SNAPSHOT.jar"/>
+ </fileset>
+ <condition property="#tuscany-version" value="1.7-SNAPSHOT">
+ <resourcecount refid="#tuscany-assembly-1.7-SNAPSHOT" when="greater" count="0"/>
+ </condition>
+ <condition property="#tuscany-baseversion" value="1.7">
+ <resourcecount refid="#tuscany-assembly-1.7-SNAPSHOT" when="greater" count="0"/>
+ </condition>
+ <condition property="#tuscany-repo" value="m2-snapshot-repository">
+ <resourcecount refid="#tuscany-assembly-1.7-SNAPSHOT" when="greater" count="0"/>
+ </condition>
+ </target>
+
+ <!-- find the Tuscany SCA version that matches the JAVA_HOME environment variable -->
+ <target name="#find-tuscany-version" depends="#find-tuscany-1.5.1, #find-tuscany-1.6-SNAPSHOT,
+ #find-tuscany-1.6, #find-tuscany-1.7-SNAPSHOT">
+ <fail unless="#tuscany-version">
+ Error: Unknown Tuscany version for JAVA_HOME environment variable.
+ </fail>
+ </target>
+
+ <!-- check whether the installed Tuscany SCA binary distribution includes implementation.web support -->
+ <target name="#check-implementation-web">
+ <fileset id="#implweb-before-copy" dir="${env.TUSCANY_HOME}/modules">
+ <include name="tuscany-implementation-web-${#tuscany-version}.jar"/>
+ <include name="tuscany-implementation-web-runtime-${#tuscany-version}.jar"/>
+ </fileset>
+ <condition property="#has-implementation-web">
+ <resourcecount refid="#implweb-before-copy" when="equal" count="2"/>
+ </condition>
+ </target>
+
+ <!-- check whether the installed Tuscany SCA binary distribution is a snapshot -->
+ <target name="#check-tuscany-snapshot">
+ <condition property="#tuscany-snapshot">
+ <equals arg1="${#tuscany-repo}" arg2="m2-snapshot-repository"/>
+ </condition>
+ </target>
+
+ <!-- copy implementation.web support to the installed Tuscany SCA snapshot binary distribution -->
+ <target name="#copy-impl-web-snapshot" if="#tuscany-snapshot">
+ <xmlproperty>
+ <url url="http://people.apache.org/repo/${#tuscany-repo}/org/apache/tuscany/sca/tuscany-implementation-web/${#tuscany-version}/maven-metadata.xml"/>
+ </xmlproperty>
+ <copy todir="${env.TUSCANY_HOME}/modules" flatten="true">
+ <url url="http://people.apache.org/repo/${#tuscany-repo}/org/apache/tuscany/sca/tuscany-implementation-web/${#tuscany-version}/tuscany-implementation-web-${#tuscany-baseversion}-${metadata.versioning.snapshot.timestamp}-${metadata.versioning.snapshot.buildNumber}.jar"/>
+ <url url="http://people.apache.org/repo/${#tuscany-repo}/org/apache/tuscany/sca/tuscany-implementation-web-runtime/${#tuscany-version}/tuscany-implementation-web-runtime-${#tuscany-baseversion}-${metadata.versioning.snapshot.timestamp}-${metadata.versioning.snapshot.buildNumber}.jar"/>
+ </copy>
+ <!-- need to copy and move because of ant 1.7.1 bug when copying with tofile and url -->
+ <move file="${env.TUSCANY_HOME}/modules/tuscany-implementation-web-${#tuscany-baseversion}-${metadata.versioning.snapshot.timestamp}-${metadata.versioning.snapshot.buildNumber}.jar" tofile="${env.TUSCANY_HOME}/modules/tuscany-implementation-web-${#tuscany-version}.jar"/>
+ <move file="${env.TUSCANY_HOME}/modules/tuscany-implementation-web-runtime-${#tuscany-baseversion}-${metadata.versioning.snapshot.timestamp}-${metadata.versioning.snapshot.buildNumber}.jar" tofile="${env.TUSCANY_HOME}/modules/tuscany-implementation-web-runtime-${#tuscany-version}.jar"/>
+ </target>
+
+ <!-- copy implementation.web support to the installed Tuscany SCA non-snapshot binary distribution -->
+ <target name="#copy-impl-web-nonsnapshot" unless="#tuscany-snapshot">
+ <copy todir="${env.TUSCANY_HOME}/modules" flatten="true">
+ <url url="http://people.apache.org/repo/${#tuscany-repo}/org/apache/tuscany/sca/tuscany-implementation-web/${#tuscany-version}/tuscany-implementation-web-${#tuscany-version}.jar"/>
+ <url url="http://people.apache.org/repo/${#tuscany-repo}/org/apache/tuscany/sca/tuscany-implementation-web-runtime/${#tuscany-version}/tuscany-implementation-web-runtime-${#tuscany-version}.jar"/>
+ </copy>
+ </target>
+
+ <!-- copy implementation.web support to the installed Tuscany SCA binary distribution -->
+ <target name="#copy-implementation-web" depends="#check-tuscany-snapshot, #copy-impl-web-snapshot, #copy-impl-web-nonsnapshot"/>
+
+ <!-- add implementation.web support to the installed Tuscany SCA binary distribution if not already there -->
+ <target name="add-implementation-web" depends="#find-tuscany-version, #check-implementation-web" unless="#has-implementation-web">
+ <antcall target="#copy-implementation-web"/>
+ <fileset id="#implweb-after-copy" dir="${env.TUSCANY_HOME}/modules">
+ <include name="tuscany-implementation-web-${#tuscany-version}.jar"/>
+ <include name="tuscany-implementation-web-runtime-${#tuscany-version}.jar"/>
+ </fileset>
+ <condition property="#implementation-web-copied">
+ <resourcecount refid="#implweb-after-copy" when="equal" count="2"/>
+ </condition>
+ <fail unless="#implementation-web-copied">
+ Error: Unable to download tuscany-implementation-web and tuscany-implementation-web-runtime jars.
+ </fail>
+ </target>
+
<!-- check whether there are any files in the webapp directory -->
<target name="#check-webapp">
<fileset id="#webappfiles" dir="src/main/webapp"/>
@@ -410,16 +536,12 @@
<!-- build a war file if there are files in the webapp directory -->
<target name="#package-war" if="#webapp">
- <fileset id="#tuscanyjars" dir="${env.TUSCANY_HOME}/modules">
- <include name="tuscany-node-api-*.jar"/>
- <include name="tuscany-node-launcher-*.jar"/>
- <include name="tuscany-sca-api-*.jar"/>
- <exclude name="tuscany-sca-api-extension-*.jar"/>
- </fileset>
+ <mkdir dir="target/lib"/>
+ <antcall target="copy-lib"/>
<war destfile="target/${ant.project.name}.war" webxml="src/main/webapp/WEB-INF/web.xml"
excludes="**/*.cbp">
<fileset dir="src/main/webapp"/>
- <lib refid="#tuscanyjars"/>
+ <lib dir="target/lib"/>
<classes dir="target/classes"/>
</war>
</target>