Allow control of jack used for compilation

Version of Jack used to compile a module can now be control from
a dedicated mk located in prebuilts/sdk/tools

Bug: 24564814

Change-Id: Ie8120c97e0fa10953d4d015afd27aacfac80e5b6
This commit is contained in:
Yohann Roussel 2015-07-03 15:46:51 +02:00
parent 1ff557c21c
commit b68c9a498d
7 changed files with 24 additions and 6 deletions

View File

@ -478,12 +478,6 @@ DEFAULT_JACK_ENABLED:=full
else else
DEFAULT_JACK_ENABLED:= DEFAULT_JACK_ENABLED:=
endif endif
# call jack
#
# $(1): jack perf arguments
define call-jack
$(JACK) $(1)
endef
ifneq ($(ANDROID_JACK_EXTRA_ARGS),) ifneq ($(ANDROID_JACK_EXTRA_ARGS),)
DEFAULT_JACK_EXTRA_ARGS := $(ANDROID_JACK_EXTRA_ARGS) DEFAULT_JACK_EXTRA_ARGS := $(ANDROID_JACK_EXTRA_ARGS)
else else

View File

@ -17,7 +17,9 @@
ifdef ANDROID_FORCE_JACK_ENABLED ifdef ANDROID_FORCE_JACK_ENABLED
LOCAL_JACK_ENABLED := $(ANDROID_FORCE_JACK_ENABLED) LOCAL_JACK_ENABLED := $(ANDROID_FORCE_JACK_ENABLED)
endif endif
LOCAL_JACK_ENABLED := $(strip $(LOCAL_JACK_ENABLED)) LOCAL_JACK_ENABLED := $(strip $(LOCAL_JACK_ENABLED))
ifneq ($(LOCAL_JACK_ENABLED),full) ifneq ($(LOCAL_JACK_ENABLED),full)
ifneq ($(LOCAL_JACK_ENABLED),incremental) ifneq ($(LOCAL_JACK_ENABLED),incremental)
ifdef LOCAL_JACK_ENABLED ifdef LOCAL_JACK_ENABLED
@ -28,3 +30,9 @@ endif
LOCAL_JACK_ENABLED := LOCAL_JACK_ENABLED :=
endif endif
endif endif
ifdef $(LOCAL_MODULE).JACK_VERSION
LOCAL_JACK_VERSION := $($(LOCAL_MODULE).JACK_VERSION)
else
LOCAL_JACK_VERSION := $(JACK_DEFAULT_VERSION)
endif

View File

@ -1756,6 +1756,13 @@ define unzip-jar-files
$(if $(PRIVATE_DONT_DELETE_JAR_META_INF),,;rm -rf $(2)/META-INF) $(if $(PRIVATE_DONT_DELETE_JAR_META_INF),,;rm -rf $(2)/META-INF)
endef endef
# Call jack
#
# $(1): jack extra arguments
define call-jack
JACK_VERSION=$(PRIVATE_JACK_VERSION) $(JACK) $(1)
endef
# Common definition to invoke javac on the host and target. # Common definition to invoke javac on the host and target.
# #
# Some historical notes: # Some historical notes:

View File

@ -123,6 +123,7 @@ endif
$(built_dex): PRIVATE_CLASSES_JACK := $(full_classes_jack) $(built_dex): PRIVATE_CLASSES_JACK := $(full_classes_jack)
$(built_dex): PRIVATE_JACK_FLAGS := $(GLOBAL_JAVAC_DEBUG_FLAGS) $(LOCAL_JACK_FLAGS) $(built_dex): PRIVATE_JACK_FLAGS := $(GLOBAL_JAVAC_DEBUG_FLAGS) $(LOCAL_JACK_FLAGS)
$(built_dex): PRIVATE_JACK_VERSION := $(LOCAL_JACK_VERSION)
$(built_dex): $(java_sources) $(java_resource_sources) $(full_jack_lib_deps) \ $(built_dex): $(java_sources) $(java_resource_sources) $(full_jack_lib_deps) \
$(jar_manifest_file) $(proto_java_sources_file_stamp) $(LOCAL_MODULE_MAKEFILE_DEP) \ $(jar_manifest_file) $(proto_java_sources_file_stamp) $(LOCAL_MODULE_MAKEFILE_DEP) \
$(LOCAL_ADDITIONAL_DEPENDENCIES) $(JACK) $(LOCAL_ADDITIONAL_DEPENDENCIES) $(JACK)

View File

@ -35,6 +35,7 @@ include $(BUILD_SYSTEM)/host_java_library.mk
# proguard is not supported # proguard is not supported
# *.proto files are not supported # *.proto files are not supported
$(full_classes_jack): PRIVATE_JACK_FLAGS := $(GLOBAL_JAVAC_DEBUG_FLAGS) $(LOCAL_JACK_FLAGS) $(full_classes_jack): PRIVATE_JACK_FLAGS := $(GLOBAL_JAVAC_DEBUG_FLAGS) $(LOCAL_JACK_FLAGS)
$(full_classes_jack): PRIVATE_JACK_VERSION := $(LOCAL_JACK_VERSION)
$(full_classes_jack): PRIVATE_JARJAR_RULES := $(LOCAL_JARJAR_RULES) $(full_classes_jack): PRIVATE_JARJAR_RULES := $(LOCAL_JARJAR_RULES)
$(full_classes_jack): \ $(full_classes_jack): \
PRIVATE_JACK_INTERMEDIATES_DIR := $(intermediates.COMMON)/jack-rsc PRIVATE_JACK_INTERMEDIATES_DIR := $(intermediates.COMMON)/jack-rsc

View File

@ -644,6 +644,7 @@ $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_PROGUARD_FLAGS :=
endif # LOCAL_PROGUARD_ENABLED defined endif # LOCAL_PROGUARD_ENABLED defined
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_FLAGS := $(GLOBAL_JAVAC_DEBUG_FLAGS) $(LOCAL_JACK_FLAGS) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_FLAGS := $(GLOBAL_JAVAC_DEBUG_FLAGS) $(LOCAL_JACK_FLAGS)
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_VERSION := $(LOCAL_JACK_VERSION)
jack_all_deps := $(java_sources) $(java_resource_sources) $(full_jack_lib_deps) \ jack_all_deps := $(java_sources) $(java_resource_sources) $(full_jack_lib_deps) \
$(jar_manifest_file) $(layers_file) $(RenderScript_file_stamp) $(proguard_flag_files) \ $(jar_manifest_file) $(layers_file) $(RenderScript_file_stamp) $(proguard_flag_files) \

View File

@ -312,6 +312,12 @@ TARGET_BUILD_JAVA_SUPPORT_LEVEL := platform
# The pdk (Platform Development Kit) build # The pdk (Platform Development Kit) build
include build/core/pdk_config.mk include build/core/pdk_config.mk
#
# -----------------------------------------------------------------
# Jack version configuration
include $(TOPDIR)prebuilts/sdk/tools/jack_versions.mk
include $(TOPDIR)prebuilts/sdk/tools/jack_for_module.mk
# ----------------------------------------------------------------- # -----------------------------------------------------------------
### ###
### In this section we set up the things that are different ### In this section we set up the things that are different