forked from openkylin/platform_build
Inform Jack of the min sdk
Set Jack min sdk according to LOCAL_SDK_VERSION. Gives Jack current
version when LOCAL_SDK_VERSION is not available.
Bug: 27371864
(cherry picked from commit c6383d6ec6
)
Change-Id: Ieba0219494f29d2737d2ca234317c3af7e5e72c8
This commit is contained in:
parent
914b37f4e3
commit
740ec8fe8a
|
@ -2056,6 +2056,7 @@ $(call call-jack) \
|
|||
$(call normalize-path-list,$(PRIVATE_BOOTCLASSPATH_JAVA_LIBRARIES) $(PRIVATE_ALL_JACK_LIBRARIES)))) \
|
||||
$(addprefix --import ,$(call reverse-list,$(PRIVATE_STATIC_JACK_LIBRARIES))) \
|
||||
$(if $(PRIVATE_EXTRA_JAR_ARGS),--import-resource $@.res.tmp) \
|
||||
-D jack.android.min-api-level=$(PRIVATE_JACK_MIN_SDK_VERSION) \
|
||||
-D jack.import.resource.policy=keep-first \
|
||||
-D jack.import.type.policy=keep-first \
|
||||
--output-jack $(PRIVATE_CLASSES_JACK) \
|
||||
|
@ -2099,6 +2100,7 @@ $(hide) if [ -s $@.java-source-list-uniq ] ; then \
|
|||
$(addprefix --classpath ,$(strip \
|
||||
$(call normalize-path-list,$(call reverse-list,$(PRIVATE_STATIC_JACK_LIBRARIES)) $(PRIVATE_BOOTCLASSPATH_JAVA_LIBRARIES) $(PRIVATE_ALL_JACK_LIBRARIES)))) \
|
||||
-D jack.import.resource.policy=keep-first \
|
||||
-D jack.android.min-api-level=$(PRIVATE_JACK_MIN_SDK_VERSION) \
|
||||
-D jack.import.type.policy=keep-first \
|
||||
$(if $(PRIVATE_JACK_INCREMENTAL_DIR),--incremental-folder $(PRIVATE_JACK_INCREMENTAL_DIR)) \
|
||||
@$@.java-source-list-uniq; \
|
||||
|
@ -2115,6 +2117,7 @@ define transform-jar-to-jack
|
|||
$(PRIVATE_JACK_FLAGS) \
|
||||
-D jack.import.resource.policy=keep-first \
|
||||
-D jack.import.type.policy=keep-first \
|
||||
-D jack.android.min-api-level=$(PRIVATE_JACK_MIN_SDK_VERSION) \
|
||||
--import $< \
|
||||
--import-resource $@.tmpjill.res \
|
||||
--output-jack $@
|
||||
|
@ -2230,6 +2233,7 @@ $(call call-jack) \
|
|||
$(if $(PRIVATE_EXTRA_JAR_ARGS),--import-resource $@.res.tmp) \
|
||||
-D jack.import.resource.policy=keep-first \
|
||||
-D jack.import.type.policy=keep-first \
|
||||
-D jack.android.min-api-level=$(PRIVATE_JACK_MIN_SDK_VERSION) \
|
||||
$(if $(PRIVATE_JACK_INCREMENTAL_DIR),--incremental-folder $(PRIVATE_JACK_INCREMENTAL_DIR)) \
|
||||
--output-jack $@ \
|
||||
$(addprefix --config-jarjar ,$(strip $(PRIVATE_JARJAR_RULES))) \
|
||||
|
|
|
@ -128,6 +128,7 @@ $(LOCAL_INTERMEDIATE_TARGETS): \
|
|||
endif
|
||||
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_FLAGS := $(GLOBAL_JAVAC_DEBUG_FLAGS) $(LOCAL_JACK_FLAGS)
|
||||
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_VERSION := $(LOCAL_JACK_VERSION)
|
||||
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_MIN_SDK_VERSION := $(PLATFORM_JACK_MIN_SDK_VERSION)
|
||||
|
||||
jack_all_deps := $(java_sources) $(java_resource_sources) $(full_jack_deps) \
|
||||
$(jar_manifest_file) $(proto_java_sources_file_stamp) $(LOCAL_MODULE_MAKEFILE_DEP) \
|
||||
|
|
|
@ -36,6 +36,7 @@ include $(BUILD_SYSTEM)/host_java_library.mk
|
|||
# *.proto files are not supported
|
||||
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_FLAGS := $(GLOBAL_JAVAC_DEBUG_FLAGS) $(LOCAL_JACK_FLAGS)
|
||||
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_VERSION := $(LOCAL_JACK_VERSION)
|
||||
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_MIN_SDK_VERSION := $(PLATFORM_JACK_MIN_SDK_VERSION)
|
||||
|
||||
$(full_classes_jack): PRIVATE_JARJAR_RULES := $(LOCAL_JARJAR_RULES)
|
||||
$(full_classes_jack): \
|
||||
|
|
|
@ -29,16 +29,21 @@ ifneq ($(LOCAL_SDK_VERSION),)
|
|||
ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),current)
|
||||
# Use android_stubs_current if LOCAL_SDK_VERSION is current and no TARGET_BUILD_APPS.
|
||||
LOCAL_JAVA_LIBRARIES := android_stubs_current $(LOCAL_JAVA_LIBRARIES)
|
||||
my_jack_min_sdk_version := $(PLATFORM_JACK_MIN_SDK_VERSION)
|
||||
else ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),system_current)
|
||||
LOCAL_JAVA_LIBRARIES := android_system_stubs_current $(LOCAL_JAVA_LIBRARIES)
|
||||
my_jack_min_sdk_version := $(PLATFORM_JACK_MIN_SDK_VERSION)
|
||||
else ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),test_current)
|
||||
LOCAL_JAVA_LIBRARIES := android_test_stubs_current $(LOCAL_JAVA_LIBRARIES)
|
||||
my_jack_min_sdk_version := $(PLATFORM_JACK_MIN_SDK_VERSION)
|
||||
else
|
||||
LOCAL_JAVA_LIBRARIES := sdk_v$(LOCAL_SDK_VERSION) $(LOCAL_JAVA_LIBRARIES)
|
||||
my_jack_min_sdk_version := $(LOCAL_SDK_VERSION)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
else
|
||||
my_jack_min_sdk_version := $(PLATFORM_JACK_MIN_SDK_VERSION)
|
||||
ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
|
||||
LOCAL_JAVA_LIBRARIES := $(TARGET_DEFAULT_JAVA_LIBRARIES) $(LOCAL_JAVA_LIBRARIES)
|
||||
endif
|
||||
|
@ -378,6 +383,9 @@ $(error $(LOCAL_PATH): Target java module does not define any source or resource
|
|||
endif
|
||||
endif
|
||||
|
||||
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_MIN_SDK_VERSION := $(my_jack_min_sdk_version)
|
||||
my_jack_min_sdk_version :=
|
||||
|
||||
# Since we're using intermediates.COMMON, make sure that it gets cleaned
|
||||
# properly.
|
||||
$(cleantarget): PRIVATE_CLEAN_FILES += $(intermediates.COMMON)
|
||||
|
|
|
@ -371,6 +371,7 @@ endif
|
|||
|
||||
# We may be building classes.jack from a host jar for host dalvik Java library.
|
||||
$(intermediates.COMMON)/classes.jack : PRIVATE_JACK_FLAGS:=$(LOCAL_JACK_FLAGS)
|
||||
$(intermediates.COMMON)/classes.jack : PRIVATE_JACK_MIN_SDK_VERSION := 1
|
||||
$(intermediates.COMMON)/classes.jack : $(my_src_jar) $(LOCAL_MODULE_MAKEFILE_DEP) \
|
||||
$(LOCAL_ADDITIONAL_DEPENDENCIES) $(JACK) | setup-jack-server
|
||||
$(transform-jar-to-jack)
|
||||
|
|
|
@ -58,6 +58,15 @@ ifeq "" "$(PLATFORM_SDK_VERSION)"
|
|||
PLATFORM_SDK_VERSION := 23
|
||||
endif
|
||||
|
||||
ifeq "" "$(PLATFORM_JACK_MIN_SDK_VERSION)"
|
||||
# This is definition of the min SDK version given to Jack for the current
|
||||
# platform. For released version it should be the same as
|
||||
# PLATFORM_SDK_VERSION. During development, this number may be incremented
|
||||
# before PLATFORM_SDK_VERSION if the plateform starts to add new java
|
||||
# language supports.
|
||||
PLATFORM_JACK_MIN_SDK_VERSION := 24
|
||||
endif
|
||||
|
||||
ifeq "" "$(PLATFORM_VERSION_CODENAME)"
|
||||
# This is the current development code-name, if the build is not a final
|
||||
# release build. If this is a final release build, it is simply "REL".
|
||||
|
|
Loading…
Reference in New Issue