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
Change-Id: I5db233fe09aed0fae37fe9a92658bc8f24b86cdf
diff --git a/core/definitions.mk b/core/definitions.mk
index f883122..cd8ece3 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -1991,6 +1991,7 @@
$(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) \
@@ -2034,6 +2035,7 @@
$(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; \
@@ -2050,6 +2052,7 @@
$(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 $@
@@ -2157,6 +2160,7 @@
$(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))) \