Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf4ac7a8 authored by Colin Cross's avatar Colin Cross
Browse files

Disable desugaring try-with-resources

Desugaring try-with-resources is not necessary for platform builds,
and triggers some problems for apps built as part of the platform
that target SDK versions before 19.  Disable all try-with-resource
desugaring.

Bug: 63180735
Bug: 63900665
Bug: 63901645
Test: m -j ANDROID_COMPILE_WITH_JACK=false checkbuild
Change-Id: I98b827aa1e80b43e6eb7b58254c23c7a4f7dc52d
parent c7e3e962
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2527,6 +2527,7 @@ $(if $(filter $(1),$(PLATFORM_VERSION_CODENAME)),10000,$(1))
endef

# --add-opens is required because desugar reflects via java.lang.invoke.MethodHandles.Lookup
# --desugar_try_with_resources_if_needed=false is needed due to b/63180735, b/63901645, b/63900665
define desugar-classes-jar
@echo Desugar: $@
@mkdir -p $(dir $@)
@@ -2540,6 +2541,7 @@ $(hide) $(JAVA) \
    $(addprefix --bootclasspath_entry ,$(call desugar-bootclasspath,$(PRIVATE_BOOTCLASSPATH))) \
    $(addprefix --classpath_entry ,$(PRIVATE_ALL_JAVA_LIBRARIES)) \
    --min_sdk_version $(call codename-or-sdk-to-sdk,$(PRIVATE_DEFAULT_APP_TARGET_SDK)) \
    --desugar_try_with_resources_if_needed=false \
    --allow_empty_bootclasspath \
    $(if $(filter --core-library,$(PRIVATE_DX_FLAGS)),--core_library) \
    -i $< -o $@.tmp