summaryrefslogtreecommitdiffstats
path: root/make/build-test.xml
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-06-15 05:21:43 +0200
committerSven Gothel <[email protected]>2012-06-15 05:21:43 +0200
commit54d0ff131097a2cd9a91a0c1dd84deb8b1f7d0ac (patch)
treecea4abac21e1447c8725e8bd28abf031be4dbedd /make/build-test.xml
parentcf51a97f04011ce643c42d6872f37cc69f4342aa (diff)
Fix Bug 583: Remove Android compile-time dependencies and exclude Android specific classes for non Android platforms.
Adapt to GlueGen commits: b3c9951006f9bd863244f1db3d54ac7866d66f0a, 86c1df6fdca183454ff544857f4236b646c4730d Ensure same Java JAR content regardless of build target (fix). Separate Android compilation results: jogl.all-android.jar and jogl.test-android.jar avoiding generating different content w/ non android builds. Adding ${android.abi} to APK target name (jogl.all-android.apk -> jogl.all-android-armeabi-v7a.apk) if not generic.
Diffstat (limited to 'make/build-test.xml')
-rw-r--r--make/build-test.xml94
1 files changed, 65 insertions, 29 deletions
diff --git a/make/build-test.xml b/make/build-test.xml
index 75c319068..f5437902e 100644
--- a/make/build-test.xml
+++ b/make/build-test.xml
@@ -26,7 +26,8 @@
<property name="classes" value="${build.test}/classes" />
<property name="classes.path" location="${classes}"/> <!-- absolute path -->
- <property name="java.part.test" value="com/jogamp/** jogamp/**"/>
+ <property name="java.part.test.all" value="com/jogamp/** jogamp/**"/>
+ <property name="java.part.test.android" value="com/jogamp/opengl/test/android/**"/>
<property name="java.dir.test" value="com/jogamp/opengl/test"/>
<property name="java.dir.junit" value="${java.dir.test}/junit"/>
<property name="java.dir.bugs" value="${java.dir.test}/bugs"/>
@@ -58,25 +59,10 @@
<!--
- Build/run tests/junit.
-->
- <target name="android.test.package" if="isAndroid">
- <aapt.signed
- assetsdir="resources/assets-test"
- jarsrcdir="${src}/test"
- jarbuilddir="${jar}"
- jarbasename="jogl.test"
- nativebuilddir="${lib}"
- nativebasename="non-existing"
- android.abi="${android.abi}"
- androidmanifest.path="resources/android/AndroidManifest-test.xml"
- androidresources.path="resources/android/res-test"
- jarmanifest.path="${build.test}/manifest-test.mf"
- version.code="${jogl_int_version}"
- version.name="${jogl.version.plus}" />
- </target>
-
- <target name="test.compile.java">
- <!-- Perform the junit pass Java compile -->
+ <target name="test.compile.javase">
+ <!-- Perform the junit pass Java SE compile -->
<javac destdir="${classes}"
+ excludes="${java.part.test.android}"
fork="yes"
includeAntRuntime="false"
memoryMaximumSize="${javac.memorymax}"
@@ -85,15 +71,9 @@
target="${target.targetlevel}"
bootclasspath="${target.rt.jar}"
debug="${javacdebug}" debuglevel="${javacdebuglevel}">
- <classpath refid="junit_jogl_newt_android.compile.classpath"/>
+ <classpath refid="junit_jogl_newt.compile.classpath"/>
<src path="${src.test}" />
</javac>
- <!-- include any resource files that tests may require -->
- <copy todir="${classes}">
- <fileset dir="${src.test}">
- <exclude name="**/*.java"/>
- </fileset>
- </copy>
<copy file="joglversion-test"
tofile="${build.test}/manifest-test.mf"
overwrite="true">
@@ -109,9 +89,59 @@
<!-- get all class files, but skip any resource files that external tools
might have copied into the class directory (otherwise, it's possible
to get the same resource file twice in the jar) -->
- <fileset dir="${classes}" includes="${java.part.test}"/>
+ <fileset dir="${classes}"
+ includes="${java.part.test.all}"
+ excludes="${java.part.test.android}"/>
+ <fileset dir="resources/assets-test" includes="**" />
+ </jar>
+ </target>
+
+ <target name="test.compile.android" if="isAndroid">
+ <!-- Perform the junit pass Java Android compile -->
+ <javac destdir="${classes}"
+ fork="yes"
+ includeAntRuntime="false"
+ memoryMaximumSize="${javac.memorymax}"
+ encoding="UTF-8"
+ source="${target.sourcelevel}"
+ target="${target.targetlevel}"
+ bootclasspath="${target.rt.jar}"
+ debug="${javacdebug}" debuglevel="${javacdebuglevel}">
+ <classpath refid="junit_jogl_newt_android.compile.classpath"/>
+ <src path="${src.test}" />
+ </javac>
+ <copy file="joglversion-test-android"
+ tofile="${build.test}/manifest-test-android.mf"
+ overwrite="true">
+ <filterset>
+ <filter token="VERSION" value="${jogl.version}"/>
+ <filter token="SCM_BRANCH" value="${jogl.build.branch}"/>
+ <filter token="SCM_COMMIT" value="${jogl.build.commit}"/>
+ <filter token="BASEVERSION" value="${jogl_base_version}"/>
+ </filterset>
+ </copy>
+
+ <jar manifest="${build.test}/manifest-test-android.mf" destfile="${jogl.test-android.jar}" filesonly="true">
+ <!-- get all class files, but skip any resource files that external tools
+ might have copied into the class directory (otherwise, it's possible
+ to get the same resource file twice in the jar) -->
+ <fileset dir="${classes}"
+ includes="${java.part.test.all}"/>
<fileset dir="resources/assets-test" includes="**" />
</jar>
+
+ <aapt.signed
+ assetsdir="resources/assets-test"
+ jarsrcdir="${src}/test"
+ jarbuilddir="${jar}"
+ jarbasename="jogl.test-android"
+ nativebuilddir="${lib}"
+ nativebasename="non-existing"
+ androidmanifest.path="resources/android/AndroidManifest-test.xml"
+ androidresources.path="resources/android/res-test"
+ jarmanifest.path="${build.test}/manifest-test-android.mf"
+ version.code="${jogl_int_version}"
+ version.name="${jogl.version.plus}" />
</target>
<target name="test.compile.check" depends="declare.common">
@@ -134,8 +164,14 @@
</target>
<target name="test.compile" depends="test.compile.check" unless="test.compile.skip">
- <antcall target="test.compile.java" inheritRefs="true" inheritAll="true"/>
- <antcall target="android.test.package" inheritRefs="true" inheritAll="true"/>
+ <!-- include any resource files that tests may require -->
+ <copy todir="${classes}">
+ <fileset dir="${src.test}">
+ <exclude name="**/*.java"/>
+ </fileset>
+ </copy>
+ <antcall target="test.compile.javase" inheritRefs="true" inheritAll="true"/>
+ <antcall target="test.compile.android" inheritRefs="true" inheritAll="true"/>
</target>
<target name="test.manual.run" depends="test.compile">