aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorPo Lu2024-04-10 22:33:08 +0800
committerPo Lu2024-04-10 22:33:08 +0800
commited88bed3afbc9922f020cf3a8803e08f2811e89b (patch)
treed5264a7a60343ca631cee644c1b0c988f56fe175 /java
parentf2f13fa630bd2658ea3f90c4362fe6201d32e67e (diff)
downloademacs-ed88bed3afbc9922f020cf3a8803e08f2811e89b.tar.gz
emacs-ed88bed3afbc9922f020cf3a8803e08f2811e89b.zip
Optimize generated Android DEX bytecode
* configure.ac (D8): Attempt to locate the bundle where d8 is installed, detect whether an installation of `r8' is similarly present, and use this installation in place of d8 if so. * java/Makefile.in (ANDROID_MIN_SDK, IS_D8_R8): New substitutions. (classes.dex): Provide --min-api, --debug or --release and --pg-conf to d8 or r8.
Diffstat (limited to 'java')
-rw-r--r--java/Makefile.in14
1 files changed, 12 insertions, 2 deletions
diff --git a/java/Makefile.in b/java/Makefile.in
index c23b52ed44e..daa577467c1 100644
--- a/java/Makefile.in
+++ b/java/Makefile.in
@@ -98,6 +98,12 @@ JAVA_FILES := $(filter-out $(RESOURCE_FILE),$(JAVA_FILES))
98ANDROID_MIN_SDK := @ANDROID_MIN_SDK@ 98ANDROID_MIN_SDK := @ANDROID_MIN_SDK@
99APK_NAME := emacs-$(version)-$(ANDROID_MIN_SDK)-$(ANDROID_ABI).apk 99APK_NAME := emacs-$(version)-$(ANDROID_MIN_SDK)-$(ANDROID_ABI).apk
100 100
101# Whether or not the bundle is to be debuggable.
102ANDROID_DEBUGGABLE := @ANDROID_DEBUGGABLE@
103
104# Whether or not $(D8) is in fact the name of the `r8' optimizer binary.
105IS_D8_R8 := @IS_D8_R8@
106
101# How this stuff works. 107# How this stuff works.
102 108
103# emacs.apk depends on emacs.apk-in, which is simply a ZIP archive 109# emacs.apk depends on emacs.apk-in, which is simply a ZIP archive
@@ -299,10 +305,14 @@ $(CLASS_FILES) &: $(JAVA_FILES)
299# N.B. that find must be called all over again in case javac generated 305# N.B. that find must be called all over again in case javac generated
300# nested classes. 306# nested classes.
301 307
302classes.dex: $(CLASS_FILES) 308classes.dex: $(CLASS_FILES) $(if $(IS_D8_R8), proguard.conf)
303 $(AM_V_D8) $(D8) --classpath $(ANDROID_JAR) \ 309 $(AM_V_D8) $(D8) --classpath $(ANDROID_JAR) \
304 $(subst $$,\$$,$(shell find $(srcdir) -type f \ 310 $(subst $$,\$$,$(shell find $(srcdir) -type f \
305 -name *.class)) --output $(builddir) 311 -name *.class)) --output $(builddir) \
312 --min-api $(ANDROID_MIN_SDK) \
313 $(if $(filter false,$(ANDROID_DEBUGGABLE)),--release, \
314 --debug) \
315 $(if $(IS_D8_R8),--pg-conf proguard.conf)
306 316
307# When emacs.keystore expires, regenerate it with: 317# When emacs.keystore expires, regenerate it with:
308# 318#