Merge changes I0508b2cc,I3d6bbc36 am: 767cb900a1 am: 235e342639

am: 916de9606b

Change-Id: I824c89dc8f10912c60313023e5e1eecd610f36e3
This commit is contained in:
Colin Cross 2017-03-21 19:44:13 +00:00 committed by android-build-merger
commit 09e82eb89a
2 changed files with 11 additions and 2 deletions

View file

@ -2521,6 +2521,13 @@ define desugar-classpath
$(filter-out -classpath -bootclasspath "",$(subst :,$(space),$(1)))
endef
# Takes an sdk version that might be PLATFORM_VERSION_CODENAME (for example P),
# returns a number greater than the highest existing sdk version if it is, or
# the input if it is not.
define codename-or-sdk-to-sdk
$(if $(filter $(1),$(PLATFORM_VERSION_CODENAME)),10000,$(1))
endef
define desugar-classes-jar
@echo Desugar: $@
@mkdir -p $(dir $@)
@ -2528,7 +2535,7 @@ $(hide) rm -f $@ $@.tmp
$(hide) java -jar $(DESUGAR) \
$(addprefix --bootclasspath_entry ,$(call desugar-bootclasspath,$(PRIVATE_BOOTCLASSPATH))) \
$(addprefix --classpath_entry ,$(PRIVATE_ALL_JAVA_LIBRARIES)) \
--min_sdk_version $(PRIVATE_SDK_VERSION) \
--min_sdk_version $(call codename-or-sdk-to-sdk,$(PRIVATE_DEFAULT_APP_TARGET_SDK)) \
--allow_empty_bootclasspath \
$(if $(filter --core-library,$(PRIVATE_DX_FLAGS)),--core_library) \
-i $< -o $@.tmp
@ -2545,7 +2552,7 @@ $(hide) rm -f $(dir $@)classes*.dex
$(hide) $(DX) \
-JXms16M -JXmx2048M \
--dex --output=$(dir $@) \
--min-sdk-version=$(PRIVATE_SDK_VERSION) \
--min-sdk-version=$(call codename-or-sdk-to-sdk,$(PRIVATE_DEFAULT_APP_TARGET_SDK)) \
$(if $(NO_OPTIMIZE_DX), \
--no-optimize) \
$(if $(GENERATE_DEX_DEBUG), \

View file

@ -466,12 +466,14 @@ javac-check-$(LOCAL_MODULE) : $(full_classes_compiled_jar)
my_desugaring :=
ifndef LOCAL_JACK_ENABLED
ifeq ($(LOCAL_JAVA_LANGUAGE_VERSION),1.8)
ifndef LOCAL_IS_STATIC_JAVA_LIBRARY
my_desugaring := true
$(full_classes_desugar_jar): PRIVATE_DX_FLAGS := $(LOCAL_DX_FLAGS)
$(full_classes_desugar_jar): $(full_classes_compiled_jar) $(DESUGAR)
$(desugar-classes-jar)
endif
endif
endif
ifndef my_desugaring
full_classes_desugar_jar := $(full_classes_compiled_jar)