aboutsummaryrefslogtreecommitdiffstats
path: root/make/build.xml
diff options
context:
space:
mode:
authorRami Santina <[email protected]>2011-07-26 13:39:34 +0300
committerRami Santina <[email protected]>2011-07-26 13:39:34 +0300
commite8a8fdda769277496772444fa4f99f863e9f355a (patch)
tree82f1be259c5ef67d57e32b8cc9ae7cfaae47b9ab /make/build.xml
parent2488c4de3e5fe7c4b8258af3fb8aae9b4d5091ce (diff)
Added android packaging for android gluegen-rt.apk
the apk package can be installed on android device using adb install gluegen-rt.apk reference package on device is com.jogamp.gluegen gerenic icons is added to be replaced by jogamp logo changes to apk can be controled thru manifest lib/android/AndroidManifest.xml
Diffstat (limited to 'make/build.xml')
-rw-r--r--make/build.xml99
1 files changed, 87 insertions, 12 deletions
diff --git a/make/build.xml b/make/build.xml
index 89426ec..4c75314 100644
--- a/make/build.xml
+++ b/make/build.xml
@@ -685,30 +685,105 @@
</filterchain>
</copy>
</target>
-
+
<target name="android.package" depends="gluegen.cpptasks.detect.os,gluegen.build.check.java" if="isAndroid">
+ <property name="dex.file.name" value="classes.dex" />
+ <property name="intermediate.dex.file" location="${build}/apk-temp/${dex.file.name}" />
+ <property name="resource.package.file.name" value="${build}/gluegen-rt.ap_" />
+ <property name="signed.file.name" value="${build}/gluegen-rt-sign.ap_" />
+ <property name="release.file.name" value="${build}/gluegen-rt.apk" />
<mkdir dir="${build}/apk-temp/bin/lib/armeabi" />
+ <mkdir dir="${build}/apk-temp/bin/lib/src" />
+ <mkdir dir="${build}/apk-temp/bin/lib/assets" />
<copy todir="${build}/apk-temp/bin/lib/armeabi">
<fileset dir="${build}/obj">
<include name="*gluegen-rt.${native.library.suffix}" />
</fileset>
</copy>
-
- <delete file="${build}/gluegen-rt.apk" includeEmptyDirs="true" quiet="true" failonerror="false" />
- <exec dir="." executable="dx" logError="true" failonerror="true" failifexecutionfails="true">
+ <delete file="${intermediate.dex.file}" includeEmptyDirs="true" quiet="true" failonerror="false" />
+ <delete file="${release.file.name}" includeEmptyDirs="true" quiet="true" failonerror="false" />
+
+ <exec dir="." executable="dx" logError="true" failonerror="true" failifexecutionfails="true">
<arg line="--dex"/>
- <arg line="--output=${build}/gluegen-rt.apk"/>
+ <arg line="--output=${intermediate.dex.file}"/>
<arg line="${build}/gluegen-rt.jar"/>
<arg line="${build}/apk-temp/"/> <!-- need to be installed .. etc -->
</exec>
- <delete file="${build}/gluegen.apk" includeEmptyDirs="true" quiet="true" failonerror="false" />
- <exec dir="." executable="dx" logError="true" failonerror="true" failifexecutionfails="true">
- <arg line="--dex"/>
- <arg line="--output=${build}/gluegen.apk"/>
- <arg line="${build}/gluegen.jar"/>
- <arg line="${build}/apk-temp/"/> <!-- need to be installed .. etc -->
- </exec>
+
+ <property name="version.code" value="" />
+ <property name="build.packaging.debug" value="false" />
+ <property name="build.signing.debug" value="false" />
+ <property name="resource.dir" value="lib/android/res" />
+ <property name="resource.absolute.dir" location="${resource.dir}" />
+ <property name="filter.abi" value="" />
+
+ <path id="android.antlibs">
+ <pathelement path="${env.ANDROID_SDK_HOME}/tools/lib/anttasks.jar" />
+ <pathelement path="${env.ANDROID_SDK_HOME}/tools/lib/sdklib.jar" />
+ <pathelement path="${env.ANDROID_SDK_HOME}/tools/lib/androidprefs.jar" />
+ <pathelement path="${env.ANDROID_SDK_HOME}/tools/lib/apkbuilder.jar" />
+ <pathelement path="${env.ANDROID_SDK_HOME}/tools/lib/jarutils.jar" />
+ </path>
+
+ <echo>Packaging resources</echo>
+ <exec dir="." executable="aapt" logError="true" failonerror="true" failifexecutionfails="true">
+ <arg line="package"/>
+ <arg line="-v"/>
+ <arg line="--debug-mode"/>
+ <arg line="-f"/>
+ <arg line="-j"/>
+ <arg line="${build}/gluegen-rt.jar"/>
+ <arg line="-M"/>
+ <arg line="lib/android/AndroidManifest.xml"/>
+ <arg line="-S"/>
+ <arg line="lib/android/res"/>
+ <arg line="-A"/>
+ <arg line="${build}/apk-temp/bin/lib/assets"/>
+ <arg line="-I"/>
+ <arg line="${env.ANDROID_SDK_HOME}/platforms/android-${env.ANDROID_SDK_VERSION}/android.jar"/>
+ <arg line="-F"/>
+ <arg line="${resource.package.file.name}"/>
+ <arg line="${build}/apk-temp/"/>
+ </exec>
+
+ <!-- TODO: Remove temp key and use jogamp signer -->
+ <echo>Generating temp debug key...</echo>
+ <exec dir="." executable="keytool" failonerror="true">
+ <arg value="-genkey "/>
+ <arg value="-alias" />
+ <arg value="debug" />
+ <arg value="-keystore" />
+ <arg value="${build}/apk-temp/debug.keystore" />
+ <arg value="-keypass" />
+ <arg value="jogamp" />
+ <arg value="-dname" />
+ <arg value="CN=GLUEGEN Debug,O=JOGAMP,C=US" />
+ <arg value="-storepass" />
+ <arg value="jogamp" />
+ </exec>
+
+ <echo>Signing apk...</echo> <!-- needed for install on device -->
+ <signjar
+ jar="${resource.package.file.name}"
+ signedjar="${signed.file.name}"
+ keystore="${build}/apk-temp/debug.keystore"
+ storepass="jogamp"
+ alias="debug"
+ keypass="jogamp"
+ verbose="true" />
+
+ <echo>Running zip align on final apk...</echo>
+ <exec dir="." executable="${env.ANDROID_SDK_HOME}/tools/zipalign" failonerror="true">
+ <arg line="-v" />
+ <arg value="-f" />
+ <arg value="4" />
+ <arg path="${signed.file.name}" />
+ <arg path="${release.file.name}" />
+ </exec>
+
<delete dir="${build}/apk-temp" includeEmptyDirs="true" quiet="true" failonerror="false" />
+ <delete file="${resource.package.file.name}" includeEmptyDirs="true" quiet="true" failonerror="false" />
+ <delete file="${signed.file.name}" includeEmptyDirs="true" quiet="true" failonerror="false" />
</target>
<target name="base.compile" depends="init, gluegen.build.java, gluegen.build.c, tag.build" />