summaryrefslogtreecommitdiffstats
path: root/core/static_java_library.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/static_java_library.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/static_java_library.mk')
-rw-r--r--core/static_java_library.mk14
1 files changed, 12 insertions, 2 deletions
diff --git a/core/static_java_library.mk b/core/static_java_library.mk
index 02078e0..ecdfeeb 100644
--- a/core/static_java_library.mk
+++ b/core/static_java_library.mk
@@ -56,8 +56,16 @@ intermediates.COMMON := $(call local-intermediates-dir,COMMON)
ifneq ($(LOCAL_PROGUARD_ENABLED),custom)
proguard_options_file := $(intermediates.COMMON)/proguard_options
endif
+
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
+
endif # LOCAL_RESOURCE_DIR
all_res_assets := $(all_resources)
@@ -114,9 +122,11 @@ $(R_file_stamp) : $(all_resources) $(full_android_manifest) $(AAPT) $(framework_
$(hide) find $(PRIVATE_SOURCE_INTERMEDIATES_DIR) -name R.java | xargs cat > $@
$(LOCAL_BUILT_MODULE): $(R_file_stamp)
-ifneq ($(full_classes_jar),)
+ifeq ($(strip $(LOCAL_USE_JACK)),true)
+$(noshrob_classes_jack): $(R_file_stamp)
+$(full_classes_jack): $(R_file_stamp)
+endif # LOCAL_USE_JACK
$(full_classes_compiled_jar): $(R_file_stamp)
-endif
endif # need_compile_res