From ec17af3364525001703701a6186de75e5c9bb2be Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 21 Sep 2018 12:36:53 -0700 Subject: [PATCH] Pass classpath to d8 d8 requires the full classpath if --min-api requires default method or try-with-resources desugaring. Always pass the full classpath, since it will already have been built to generate the input jar. Bug: 116243313 Test: m checkbuild Change-Id: I363b4d3145e23d4eed77455c1897430206f3ac22 --- core/definitions.mk | 1 + core/java.mk | 2 ++ 2 files changed, 3 insertions(+) diff --git a/core/definitions.mk b/core/definitions.mk index 2dff9cfe7..25c3e8757 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -2289,6 +2289,7 @@ $(hide) rm -f $(dir $@)classes*.dex $(dir $@)d8_input.jar $(hide) $(ZIP2ZIP) -j -i $< -o $(dir $@)d8_input.jar "**/*.class" $(hide) $(DX_COMMAND) \ --output $(dir $@) \ + $(addprefix --lib ,$(PRIVATE_D8_LIBS)) \ --min-api $(PRIVATE_MIN_SDK_VERSION) \ $(subst --main-dex-list=, --main-dex-list , \ $(filter-out --core-library --multi-dex --minimal-main-dex,$(PRIVATE_DX_FLAGS))) \ diff --git a/core/java.mk b/core/java.mk index cf9bf5661..6ca2904cb 100644 --- a/core/java.mk +++ b/core/java.mk @@ -494,6 +494,8 @@ ifdef LOCAL_PROGUARD_ENABLED $(built_dex_intermediate) : $(full_classes_pre_proguard_jar) $(extra_input_jar) $(my_proguard_sdk_raise) $(common_proguard_flag_files) $(proguard_flag_files) $(legacy_proguard_lib_deps) $(R8_COMPAT_PROGUARD) $(transform-jar-to-dex-r8) else # !LOCAL_PROGUARD_ENABLED + $(built_dex_intermediate): PRIVATE_D8_LIBS := $(full_java_bootclasspath_libs) $(full_shared_java_header_libs) + $(built_dex_intermediate): $(full_java_bootclasspath_libs) $(full_shared_java_header_libs) $(built_dex_intermediate): $(full_classes_pre_proguard_jar) $(DX) $(ZIP2ZIP) $(transform-classes.jar-to-dex) endif