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

Commit a94e4ca2 authored by David Brazdil's avatar David Brazdil
Browse files

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
parent a9966c7c
Loading
Loading
Loading
Loading
+44 −38
Original line number Diff line number Diff line
@@ -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)