Add USE_D8_DESUGAR option in build/core

Add an option to use D8's desugar instead of the standalone version.

USE_D8_DESUGAR=true m would trigger DCHECK in dex2oat unless
https://android-review.googlesource.com/c/platform/art/+/562595 is
patched in as well.

Bug: 69329508
Test: m && USE_D8_DESUGAR=false m

Change-Id: I601dada44c361e45bbc0e2227ae1544a7d9efa90
This commit is contained in:
Alan Leung
2017-12-01 14:32:58 -08:00
parent 10c9f5d9d3
commit eaafb3cd37
3 changed files with 25 additions and 0 deletions

View File

@@ -173,7 +173,11 @@ else # !LOCAL_IS_STATIC_JAVA_LIBRARY
$(built_dex): PRIVATE_INTERMEDIATES_DIR := $(intermediates.COMMON)
$(built_dex): PRIVATE_DX_FLAGS := $(LOCAL_DX_FLAGS)
$(built_dex): $(full_classes_desugar_jar) $(DX)
ifneq ($(USE_D8_DESUGAR),true)
$(transform-classes.jar-to-dex)
else
$(transform-classes-d8.jar-to-dex)
endif
$(LOCAL_BUILT_MODULE): PRIVATE_DEX_FILE := $(built_dex)
$(LOCAL_BUILT_MODULE): PRIVATE_SOURCE_ARCHIVE := $(full_classes_jarjar_jar)