Merge "Avoid feeding D8 with dex files." am: c0eabe6d34

am: 6bba1f1ca2

Change-Id: Iac7057b19c71e0330a8f03b8f235a33ef1416651
This commit is contained in:
Alan Leung 2017-12-13 02:34:15 +00:00 committed by android-build-merger
commit dae5371f64
2 changed files with 8 additions and 2 deletions

View File

@ -2415,13 +2415,15 @@ endef
define transform-classes-d8.jar-to-dex
@echo "target Dex: $(PRIVATE_MODULE)"
@mkdir -p $(dir $@)
$(hide) rm -f $(dir $@)classes*.dex
$(hide) rm -rf $(dir $@)classes*.dex $(dir $@)*.class $(dir $@)d8_input
$(hide) unzip -qq -d $(dir $@)d8_input $< "*.class"
$(hide) $(DX_COMMAND) \
--output $(dir $@) \
--min-api $(PRIVATE_MIN_SDK_VERSION) \
$(subst --no-locals, --release, \
$(filter-out --core-library --multi-dex,$(PRIVATE_DX_FLAGS))) \
$<
$$(find $(dir $@)d8_input -name *.class | sort)
$(hide) rm -fr $(dir $@)d8_input
endef
# Create a mostly-empty .jar file that we'll add to later.

View File

@ -150,6 +150,7 @@ endif
$(eval $(call copy-one-file,$(full_classes_jarjar_jar),$(full_classes_jar)))
ifneq ($(USE_D8_DESUGAR),true)
my_desugaring :=
ifeq ($(LOCAL_JAVA_LANGUAGE_VERSION),1.8)
my_desugaring := true
@ -157,6 +158,9 @@ $(full_classes_desugar_jar): PRIVATE_DX_FLAGS := $(LOCAL_DX_FLAGS)
$(full_classes_desugar_jar): $(full_classes_jar) $(full_java_header_libs) $(DESUGAR)
$(desugar-classes-jar)
endif
else
my_desugaring :=
endif
ifndef my_desugaring
full_classes_desugar_jar := $(full_classes_jar)