Make classes.jar the output of uninstallable Soong Java modules

The soong_java_prebuilt.mk file used to assume that if a Soong module
defines a dex jar, it is the output of the module and the module is
installable. This may now not be true if the module uses 'compile_dex'
to define a secondary build rule for a dex jar. If the module is not
installable (LOCAL_UNINSTALLABLE_MODULE=true), do not attempt to preopt
and copy classes.jar to the modules output destination.

Bug: 79409988
Test: on related CL
Change-Id: Ica958ac793e09a0e52125448b44e7cd36e7f35d5
This commit is contained in:
David Brazdil
2018-07-03 15:59:48 +01:00
parent a9966c7c60
commit a94e4ca2c6

View File

@@ -79,6 +79,7 @@ endif
endif # TURBINE_ENABLED != false
ifdef LOCAL_SOONG_DEX_JAR
ifneq ($(LOCAL_UNINSTALLABLE_MODULE),true)
ifndef LOCAL_IS_HOST_MODULE
ifneq ($(filter $(LOCAL_MODULE),$(PRODUCT_BOOT_JARS)),) # is_boot_jar
$(eval $(call hiddenapi-copy-soong-jar,$(LOCAL_SOONG_DEX_JAR),$(common_javalib.jar)))
@@ -119,9 +120,14 @@ $(built_odex) : $(dir $(LOCAL_BUILT_MODULE))% : $(common_javalib.jar)
endif
java-dex : $(LOCAL_BUILT_MODULE)
else
else # LOCAL_UNINSTALLABLE_MODULE
$(eval $(call copy-one-file,$(full_classes_jar),$(LOCAL_BUILT_MODULE)))
endif
$(eval $(call copy-one-file,$(LOCAL_SOONG_DEX_JAR),$(common_javalib.jar)))
java-dex : $(common_javalib.jar)
endif # LOCAL_UNINSTALLABLE_MODULE
else # LOCAL_SOONG_DEX_JAR
$(eval $(call copy-one-file,$(full_classes_jar),$(LOCAL_BUILT_MODULE)))
endif # LOCAL_SOONG_DEX_JAR
javac-check : $(full_classes_jar)
javac-check-$(LOCAL_MODULE) : $(full_classes_jar)