diff options
-rwxr-xr-x | make/Manifest-rt-android | 13 | ||||
-rw-r--r-- | make/build-test.xml | 2 | ||||
-rw-r--r-- | make/build.xml | 87 | ||||
-rw-r--r-- | make/jogamp-androidtasks.xml | 17 | ||||
-rwxr-xr-x | make/scripts/adb-install-all-armv7.sh | 2 |
5 files changed, 90 insertions, 31 deletions
diff --git a/make/Manifest-rt-android b/make/Manifest-rt-android new file mode 100755 index 0000000..da1d122 --- /dev/null +++ b/make/Manifest-rt-android @@ -0,0 +1,13 @@ +Manifest-Version: 1.0 +Specification-Title: GlueGen Java Bindings Generator +Specification-Version: @BASEVERSION@ +Specification-Vendor: JogAmp Community +Implementation-Title: GlueGen Run-Time For Android +Implementation-Version: @VERSION@ +Implementation-Branch: @SCM_BRANCH@ +Implementation-Commit: @SCM_COMMIT@ +Implementation-Vendor: JogAmp Community +Implementation-Vendor-Id: com.jogamp +Implementation-URL: http://jogamp.org/ +Extension-Name: com.jogamp.common +Trusted-Library: true diff --git a/make/build-test.xml b/make/build-test.xml index 16f9659..3c87650 100644 --- a/make/build-test.xml +++ b/make/build-test.xml @@ -144,11 +144,11 @@ jarbasename="gluegen-test" nativebuilddir="${build_t.lib}" nativebasename="test" + android.abi="${android.abi}" androidmanifest.path="resources/android/AndroidManifest-Test.xml" androidresources.path="resources/android/res" version.code="${gluegen_int_version}" version.name="${gluegen.version.plus}" - android.abi="${android.abi}" /> </target> diff --git a/make/build.xml b/make/build.xml index ded1154..9b4e316 100644 --- a/make/build.xml +++ b/make/build.xml @@ -26,12 +26,10 @@ <property name="gluegen.excludes.nsig" value="com/jogamp/gluegen/runtime/BufferFactoryInternal.java com/jogamp/gluegen/nativesig/**" /> </target> - <target name="init.base" depends="jogamp.env.init,gluegen.properties.load.user,gluegen.cpptasks.detect.os,setup.excludes.nsig"/> - - <target name="init.std" unless="isAndroid" > + <target name="init.base" depends="jogamp.env.init,gluegen.properties.load.user,gluegen.cpptasks.detect.os,setup.excludes.nsig"> <!-- Create the classpath for compiling GlueGen. This requires the user-defined "antlr.jar" property. --> - <path id="gluegencompile.classpath"> + <path id="cc_gluegen.classpath"> <pathelement location="${antlr.jar}" /> </path> </target> @@ -44,13 +42,13 @@ <!-- Create the classpath for compiling GlueGen. This requires the user-defined "antlr.jar" property. --> - <path id="gluegencompile.classpath"> + <path id="cc_gluegen_android.classpath"> <pathelement location="${antlr.jar}" /> <pathelement location="${android-min.jar}"/> </path> </target> - <target name="init" depends="init.base,init.std,init.android"> + <target name="init" depends="init.base, init.android"> <!-- Declare all paths and user defined variables. --> <!-- property name="javadoc.link" value="http://java.sun.com/j2se/1.4.2/docs/api/" /--> @@ -152,11 +150,7 @@ <property name="gluegen-rt.classes" value="com/jogamp/gluegen/runtime/**"/> <property name="jogamp.common.classes" value="com/jogamp/common/** jogamp/common/**"/> - <condition property="java.excludes.android" value="${java.part.android}"> - <not> <isset property="isAndroid"/> </not> - </condition> - - <property name="gluegen.excludes.all" value="${gluegen.excludes.nsig} ${jogamp.android-launcher.classes} ${java.excludes.android}" /> + <property name="gluegen.excludes.all" value="${gluegen.excludes.nsig} ${jogamp.android-launcher.classes}" /> </target> @@ -618,9 +612,7 @@ </uptodate> </target> - <target name="gluegen.build.java" depends="gluegen.cpptasks.detect.os,gluegen.build.check.java" unless="gluegen.build.skip.java"> - <antcall target="generate-hash-maps" inheritRefs="true"/> - + <target name="gluegen.build.javase"> <!-- Because ANTLR looks for importVocab files in the current working directory, it likes to have all of its files, including supergrammars, in one place, so copy all of the @@ -675,7 +667,7 @@ <javac destdir="${classes}" includeAntRuntime="false" includes="${gluegen-rt.classes} ${jogamp.common.classes}" - excludes="${gluegen.excludes.all}" + excludes="${gluegen.excludes.all} ${java.part.android}" memoryMaximumSize="${javac.memorymax}" encoding="UTF-8" source="${target.sourcelevel}" @@ -684,13 +676,13 @@ debug="${javacdebug}" debuglevel="${javacdebuglevel}"> <src path="${src.java}" /> <src path="${src.generated.java}" /> - <classpath refid="gluegencompile.classpath" /> + <classpath refid="cc_gluegen.classpath" /> </javac> <!--compile gluegen (compile time) --> <javac destdir="${classes}" includeAntRuntime="true" - excludes="${gluegen.excludes.all} ${gluegen-rt.classes}" + excludes="${gluegen.excludes.all} ${gluegen-rt.classes} ${java.part.android}" memoryMaximumSize="${javac.memorymax}" encoding="UTF-8" source="${host.sourcelevel}" @@ -699,7 +691,7 @@ debug="${javacdebug}" debuglevel="${javacdebuglevel}"> <src path="${src.java}" /> <src path="${src.generated.java}" /> - <classpath refid="gluegencompile.classpath" /> + <classpath refid="cc_gluegen.classpath" /> </javac> <copy file="Manifest" @@ -743,7 +735,7 @@ <include name="com/jogamp/common/**" /> <include name="jogamp/common/**" /> <exclude name="${jogamp.android-launcher.classes}" /> - <exclude name="${java.excludes.android}" /> + <exclude name="${java.part.android}" /> </fileset> <fileset dir="resources/assets"> <include name="**" /> @@ -766,7 +758,55 @@ </filterchain> </copy> </target> + + <target name="gluegen.build.android" if="isAndroid"> + <!--compile gluegen-rt-android first--> + <javac destdir="${classes}" + includeAntRuntime="false" + includes="${gluegen-rt.classes} ${jogamp.common.classes}" + excludes="${gluegen.excludes.all}" + memoryMaximumSize="${javac.memorymax}" + encoding="UTF-8" + source="${target.sourcelevel}" + target="${target.targetlevel}" + bootclasspath="${target.rt.jar}" + debug="${javacdebug}" debuglevel="${javacdebuglevel}"> + <src path="${src.java}" /> + <src path="${src.generated.java}" /> + <classpath refid="cc_gluegen_android.classpath" /> + </javac> + + <copy file="Manifest-rt-android" + tofile="${build}/Manifest-rt-android.temp" + overwrite="true"> + <filterset> + <filter token="VERSION" value="${gluegen.version}"/> + <filter token="SCM_BRANCH" value="${gluegen.build.branch}"/> + <filter token="SCM_COMMIT" value="${gluegen.build.commit}"/> + <filter token="BASEVERSION" value="${gluegen_base_version}"/> + </filterset> + </copy> + + <!-- Build gluegen-rt-android.jar. --> + <jar destfile="${build}/gluegen-rt-android.jar" manifest="${build}/Manifest-rt-android.temp"> + <fileset dir="${classes}"> + <include name="com/jogamp/gluegen/runtime/*.class" /> + <include name="com/jogamp/common/**" /> + <include name="jogamp/common/**" /> + <exclude name="${jogamp.android-launcher.classes}" /> + </fileset> + <fileset dir="resources/assets"> + <include name="**" /> + </fileset> + </jar> + </target> + <target name="gluegen.build.java" depends="gluegen.cpptasks.detect.os,gluegen.build.check.java" unless="gluegen.build.skip.java"> + <antcall target="generate-hash-maps" inheritRefs="true"/> + <antcall target="gluegen.build.javase" inheritRefs="true"/> + <antcall target="gluegen.build.android" inheritRefs="true"/> + </target> + <target name="gluegen.build.check.android-launcher" depends="init"> <uptodate property="gluegen.build.skip.android-launcher"> <srcfiles dir= "." includes="*.xml"/> @@ -814,10 +854,9 @@ jarbasename="jogamp.android-launcher" nativebuilddir="${build}" nativebasename="non-existing" - android.abi="generic" androidmanifest.path="resources/android/AndroidManifest-Launcher.xml" androidresources.path="resources/android/res" - jarmanifest.path="${build}//Manifest-android-launcher.temp" + jarmanifest.path="${build}/Manifest-android-launcher.temp" version.code="${gluegen_int_version}" version.name="${gluegen.version.plus}" /> @@ -828,7 +867,7 @@ <srcfiles dir= "." includes="*.xml"/> <srcfiles dir= "${src.java}" includes="**"/> <srcfiles dir= "${src.generated}" includes="**"/> - <mapper type="merge" to="${build}/gluegen-rt.apk"/> + <mapper type="merge" to="${build}/gluegen-rt-android-${android.abi}.apk"/> </uptodate> </target> @@ -837,13 +876,13 @@ <aapt.signed assetsdir="resources/assets" jarbuilddir="${build}" - jarbasename="gluegen-rt" + jarbasename="gluegen-rt-android" nativebuilddir="${gluegen.lib.dir}" nativebasename="gluegen-rt" android.abi="${android.abi}" androidmanifest.path="resources/android/AndroidManifest-Runtime.xml" androidresources.path="resources/android/res" - jarmanifest.path="${build}/Manifest-rt.temp" + jarmanifest.path="${build}/Manifest-rt-android.temp" version.code="${gluegen_int_version}" version.name="${gluegen.version.plus}" /> diff --git a/make/jogamp-androidtasks.xml b/make/jogamp-androidtasks.xml index f37e42c..3e40fe1 100644 --- a/make/jogamp-androidtasks.xml +++ b/make/jogamp-androidtasks.xml @@ -44,12 +44,13 @@ <!-- attribute name="jarclasspathrefid" default="/non.existing.jarclasspathrefid"/--> <attribute name="version.code" /> <attribute name="version.name" /> - <attribute name="android.abi" /> + <attribute name="android.abi" default="generic" /> <attribute name="keystore.file" default="/non.existing.user.keystore.file" /> <attribute name="keystore.alias" default="debug" /> <attribute name="keystore.storepass" default="jogamp" /> <attribute name="keystore.keypass" default="jogamp" /> <sequential> + <var name="m.aapt.android.abi.extstr" unset="true"/> <var name="m.aapt.build.apk" unset="true"/> <var name="m.aapt.dex.file" unset="true"/> <var name="m.aapt.unsigned.package.file.name" unset="true"/> @@ -59,11 +60,17 @@ <var name="m.aapt.java.encoding" unset="true"/> - <property name="m.aapt.build.apk" value="@{jarbuilddir}/@{jarbasename}.apk.d" /> + <condition property="m.aapt.android.abi.extstr" value="-@{android.abi}" else=""> + <not> + <equals arg1="@{android.abi}" arg2="generic" casesensitive="true" /> + </not> + </condition> + + <property name="m.aapt.build.apk" value="@{jarbuilddir}/@{jarbasename}${m.aapt.android.abi.extstr}.apk.d" /> <property name="m.aapt.dex.file" location="${m.aapt.build.apk}/image/classes.dex" /> - <property name="m.aapt.unsigned.package.file.name" value="@{jarbuilddir}/@{jarbasename}-unsigned.apk" /> - <property name="m.aapt.signed.file.name" value="${m.aapt.build.apk}/@{jarbasename}-signed-raw.apk" /> - <property name="m.aapt.release.file.name" value="@{jarbuilddir}/@{jarbasename}.apk" /> + <property name="m.aapt.unsigned.package.file.name" value="@{jarbuilddir}/@{jarbasename}${m.aapt.android.abi.extstr}-unsigned.apk" /> + <property name="m.aapt.signed.file.name" value="${m.aapt.build.apk}/@{jarbasename}${m.aapt.android.abi.extstr}-signed-raw.apk" /> + <property name="m.aapt.release.file.name" value="@{jarbuilddir}/@{jarbasename}${m.aapt.android.abi.extstr}.apk" /> <property name="m.aapt.java.encoding" value="UTF-8" /> diff --git a/make/scripts/adb-install-all-armv7.sh b/make/scripts/adb-install-all-armv7.sh index 249f16f..6f271eb 100755 --- a/make/scripts/adb-install-all-armv7.sh +++ b/make/scripts/adb-install-all-armv7.sh @@ -1,2 +1,2 @@ adb $* install ../build-android-armv7/jogamp.android-launcher.apk -adb $* install ../build-android-armv7/gluegen-rt.apk +adb $* install ../build-android-armv7/gluegen-rt-android-armeabi-v7a.apk |