diff --git a/core/definitions.mk b/core/definitions.mk index e350bd0e9..87deecb9d 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -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. diff --git a/core/host_dalvik_java_library.mk b/core/host_dalvik_java_library.mk index 8647fb424..4b12bfe72 100644 --- a/core/host_dalvik_java_library.mk +++ b/core/host_dalvik_java_library.mk @@ -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)