aboutsummaryrefslogtreecommitdiffstats
path: root/make/jogamp-androidtasks.xml
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2019-12-26 04:26:32 +0100
committerSven Gothel <[email protected]>2019-12-26 04:26:32 +0100
commit1390bc236de531646aaa4525a17de1a533b1fa06 (patch)
tree8766f44afe2adc5883f04be138dc08a9de80f219 /make/jogamp-androidtasks.xml
parentfaa37334e2912e02cb58e738570a127cc6402b37 (diff)
Bug 1417 - Android: Use d8 for dex'ing w/ implicit Java8 desugaring (macro: aapt.signed)
The new SDK d8 dex'ing tool performs Java8 desugaring, hence allows using Java8 code style. We use d8 instead of dx in the 'aapt.signed' macro of 'jogamp-androidtasks.xml'. For the proper desugaring, we pass 'android-min.jar and 'target.rt.jar' Android and Java8 system runtime jar-files to d8's classpath. Macro 'aapt.signed' also receives the new optional element 'd8-classpaths' to allows caller to pass further required jar-files to the d8 classpath. See build-test.xml.
Diffstat (limited to 'make/jogamp-androidtasks.xml')
-rw-r--r--make/jogamp-androidtasks.xml26
1 files changed, 23 insertions, 3 deletions
diff --git a/make/jogamp-androidtasks.xml b/make/jogamp-androidtasks.xml
index 172da7b..3289a2b 100644
--- a/make/jogamp-androidtasks.xml
+++ b/make/jogamp-androidtasks.xml
@@ -65,6 +65,7 @@
<attribute name="keystore.alias" default="${android.keystore.alias}" />
<attribute name="keystore.storepass" default="${android.keystore.storepass}" />
<attribute name="keystore.keypass" default="${android.keystore.keypass}" />
+ <element name="d8-classpaths" implicit="no" optional="true" />
<sequential>
<var name="m.aapt.apkbasename0" unset="true"/>
@@ -171,13 +172,32 @@
<pathelement path="${android.jar}"/>
</classpath>
</javac>
+ <zip destfile="${m.aapt.build.apk}/temp/classes.zip" level="0">
+ <fileset dir="${m.aapt.build.apk}/temp/classes"/>
+ </zip>
<echo>aapt.signed ${m.aapt.apkbasename}: dex'ing</echo>
- <exec dir="." executable="dx" logError="true" failonerror="true" failifexecutionfails="true">
- <arg line="--dex"/>
- <arg line="--output=${m.aapt.dex.file}"/>
+ <!-- exec dir="." executable="dx" logError="true" failonerror="true" failifexecutionfails="true">
+ <arg line="- -dex"/>
+ <arg line="- -output=${m.aapt.dex.file}"/>
+ <arg line="- -min-sdk-version=${android.api.level.min}"/>
<arg line="@{jarbuilddir}/@{jarbasename}.jar"/>
<arg line="${m.aapt.build.apk}/temp/classes"/>
+ </exec -->
+ <exec dir="." executable="d8" logError="true" failonerror="true" failifexecutionfails="true">
+ <arg line="--output ${m.aapt.build.apk}/image"/>
+
+ <arg line="--classpath ${android-min.jar}"/>
+ <arg line="--classpath ${target.rt.jar}"/>
+ <d8-classpaths/>
+
+ <arg line="--min-api ${android.api.level.min}"/>
+
+ <arg line="--release"/>
+ <!-- arg line="- -debug"/ -->
+
+ <arg line="@{jarbuilddir}/@{jarbasename}.jar"/>
+ <arg line="${m.aapt.build.apk}/temp/classes.zip"/>
</exec>
<echo>aapt.signed ${m.aapt.apkbasename}: packaging</echo>