summaryrefslogtreecommitdiffstats
path: root/contrib/java/build-java.xml
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-06-25 21:05:44 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-06-25 21:05:44 (GMT)
commite3767be4f9c5874d9c996200f2e9705ce31a5976 (patch)
treebe3d06f550286e23eeb3252277c1a2b7d12554ef /contrib/java/build-java.xml
parent758bda908ded461c9d34d274a18454ffba4b7450 (diff)
downloaduscxml-e3767be4f9c5874d9c996200f2e9705ce31a5976.zip
uscxml-e3767be4f9c5874d9c996200f2e9705ce31a5976.tar.gz
uscxml-e3767be4f9c5874d9c996200f2e9705ce31a5976.tar.bz2
Work on bindings
- Introduced exceptions into C# and Java - Moved binding examples to /embedding - Interpreter will now throw exceptions, beware!
Diffstat (limited to 'contrib/java/build-java.xml')
-rw-r--r--contrib/java/build-java.xml91
1 files changed, 91 insertions, 0 deletions
diff --git a/contrib/java/build-java.xml b/contrib/java/build-java.xml
new file mode 100644
index 0000000..ca5cc88
--- /dev/null
+++ b/contrib/java/build-java.xml
@@ -0,0 +1,91 @@
+<!-- This ant build script is called from CMake at configure time -->
+<project name="uscxml" default="jar">
+
+<!-- taskdef resource="net/sf/antcontrib/antcontrib.properties">
+ <classpath>
+ <pathelement location="lib/ant-contrib-1.0b3.jar"/>
+ </classpath>
+</taskdef -->
+
+<target name="compile" description="Compile the uscxml java code.">
+ <echo message="dest: ${build.dir}/src/bindings/swig/java-class/"/>
+ <echo message="src: ${build.dir}/src/bindings/swig/java/"/>
+ <echo message="src: ${src.dir}/src/bindings/swig/java/"/>
+
+ <mkdir dir="${build.dir}/src/bindings/swig/java-class/" />
+
+ <javac destdir="${build.dir}/src/bindings/swig/java-class/" debug="true" includeantruntime="false" target="1.5" source="1.5">
+ <src path="${build.dir}/src/bindings/swig/java/" />
+ <src path="${src.dir}/src/bindings/swig/java/" />
+ <!--classpath>
+ <pathelement location="${src.dir}/contrib/java/lib/protobuf-java-2.5.0.jar"/>
+ </classpath -->
+ </javac>
+</target>
+
+<target name="jar" depends="compile" description="Create a bundle of the source code">
+ <echo message="library dir: ${lib.dir}"/>
+ <echo message="source dir: ${src.dir}"/>
+ <echo message="build dir: ${build.dir}"/>
+ <echo message="build type: ${build.type}"/>
+ <echo message="exclude debug: ${exclude.debug}"/>
+ <echo message="exclude jni: ${exclude.jni}"/>
+
+ <condition property="exclude.debug.jar">
+ <equals arg1="${exclude.debug}" arg2="ON"/>
+ </condition>
+
+ <condition property="exclude.jni.jar">
+ <equals arg1="${exclude.jni}" arg2="ON"/>
+ </condition>
+
+ <!-- flatten all JNI libraries for inclusion into the fat JAR -->
+ <fileset id="all.jni" dir="${lib.dir}">
+ <include name="**/*NativeJava*.jnilib"/>
+ <include name="**/*NativeJava*.so"/>
+ <include name="**/*NativeJava*.dll"/>
+ <exclude name="cross-compiled/**"/>
+ <exclude name="linux-armv*/**"/>
+ <!-- do not include debug builds in release -->
+ <!--exclude name="**/*undocoreSwigSwig_d*" if="${exclude.debug.jar}"/ -->
+ <!--exclude name="**/*undocoreSwig64_d*" if="${exclude.debug.jar}"/ -->
+ </fileset>
+
+ <!-- Copy all JNI libraries as found above into the lib/ directory -->
+ <mkdir dir="${lib.dir}/jni" />
+ <copy todir="${lib.dir}/jni" flatten="true">
+ <fileset refid="all.jni" />
+ </copy>
+
+ <pathconvert pathsep="${line.separator}| |-- "
+ property="echo.all.jni"
+ refid="all.jni">
+ </pathconvert>
+ <echo>${echo.all.jni}</echo>
+
+ <!-- delete an eventual old jar -->
+ <delete dir="${lib.dir}/uscxml.jar" />
+
+ <!-- build new jar -->
+ <jar destfile="${lib.dir}/uscxml.jar">
+ <!-- All the class files we compiled -->
+ <fileset dir="${build.dir}/src/bindings/swig/java-class/" >
+ <include name="**/*.class" />
+ </fileset>
+ <!-- Include all source files -->
+ <fileset dir="${build.dir}/src/bindings/swig/java/" >
+ <include name="**/*.java" />
+ </fileset>
+ <fileset dir="${src.dir}/src/bindings/swig/java/" >
+ <include name="**/*.java" />
+ </fileset>
+ <!-- The JNI libraries -->
+ <fileset dir="${lib.dir}/jni" >
+ <include name="**/*" />
+ <exclude name="**/*" if="${exclude.jni.jar}" />
+ </fileset>
+ </jar>
+ <delete dir="${lib.dir}/jni" />
+</target>
+
+</project>