summaryrefslogtreecommitdiffstats
path: root/core/package_internal.mk
diff options
context:
space:
mode:
authorYohann Roussel <yroussel@google.com>2014-09-08 14:45:14 +0200
committerYohann Roussel <yroussel@google.com>2014-12-02 18:11:13 +0100
commitb4c49cba57dafdcdfb693a549c5a1dc1beb71c25 (patch)
tree779bcaabb70535105c12058aa2a77d40be5a10a3 /core/package_internal.mk
parent7fcb9209ac5823973053d954cf283a4485ad97de (diff)
downloadbuild-b4c49cba57dafdcdfb693a549c5a1dc1beb71c25.zip
build-b4c49cba57dafdcdfb693a549c5a1dc1beb71c25.tar.gz
build-b4c49cba57dafdcdfb693a549c5a1dc1beb71c25.tar.bz2
Compile using Jack.
This allows to compile dex targeted java sources using Jack and Jill. Default is still to compile with the legacy toolchain. Default can be switched to the new toolchain by setting environement variable: export ANDROID_COMPILE_WITH_JACK=true Toolchain can also be forced for one module by defining LOCAL_USE_JACK:=true # false in the mk portion defining the module. Jack execution environement can be controlled with: Global variable ANDROID_JACK_VM allow to change the jvm executing Jack. Global variable ANDROID_JACK_VM_ARGS allows to change default args given to the jvm. Global variable ANDROID_JACK_EXTRA_ARGS allows to define some default args to give to Jack LOCAL_JACK_VM_ARGS allows to override default args given to the jvm for the module. LOCAL_JACK_EXTRA_ARGS allows to override default args passed to Jack. Change-Id: Ib81a0fd5f86a51d1e0edbb81cc791d828a05dd29
Diffstat (limited to 'core/package_internal.mk')
-rw-r--r--core/package_internal.mk23
1 files changed, 23 insertions, 0 deletions
diff --git a/core/package_internal.mk b/core/package_internal.mk
index e2c3cf4..c02e9ea 100644
--- a/core/package_internal.mk
+++ b/core/package_internal.mk
@@ -161,6 +161,13 @@ endif # need_compile_res
endif # !custom
LOCAL_PROGUARD_FLAGS := $(addprefix -include ,$(proguard_options_file)) $(LOCAL_PROGUARD_FLAGS)
+ifeq ($(strip $(LOCAL_USE_JACK)),true)
+ifndef LOCAL_JACK_PROGUARD_FLAGS
+ LOCAL_JACK_PROGUARD_FLAGS := $(LOCAL_PROGUARD_FLAGS)
+endif
+LOCAL_JACK_PROGUARD_FLAGS := $(addprefix -include ,$(proguard_options_file)) $(LOCAL_JACK_PROGUARD_FLAGS)
+endif # LOCAL_USE_JACK
+
ifeq (true,$(EMMA_INSTRUMENT))
ifndef LOCAL_EMMA_INSTRUMENT
# No emma for test apks.
@@ -275,6 +282,18 @@ endif
# they want to use this module's R.java file.
$(LOCAL_BUILT_MODULE): $(R_file_stamp)
+ifeq ($(strip $(LOCAL_USE_JACK)),true)
+ifneq ($(built_dex_intermediate),)
+$(built_dex_intermediate): $(R_file_stamp)
+endif
+ifneq ($(noshrob_classes_jack),)
+$(noshrob_classes_jack): $(R_file_stamp)
+endif
+ifneq ($(full_classes_jack),)
+$(full_classes_jack): $(R_file_stamp)
+endif
+endif # LOCAL_USE_JACK
+
ifneq ($(full_classes_jar),)
# If full_classes_jar is non-empty, we're building sources.
# If we're building sources, the initial javac step (which
@@ -393,7 +412,11 @@ endif
ifneq ($(full_classes_jar),)
$(add-dex-to-package)
endif
+ifneq ($(strip $(LOCAL_USE_JACK)),true)
$(add-carried-java-resources)
+else
+ $(add-carried-jack-resources)
+endif
ifneq ($(extra_jar_args),)
$(add-java-resources-to-package)
endif