AIDEGen: Collect the classes.jar of the prebuilt modules into module-info.json

Current information is not enough if the prebuilt modules are depend on
AAR libs Therefore, AIDEGen has to collect the classes.jar of the
prebuilt modules from build system.

Build module-info.json without this change:
Build time: 1m55.001s
File size: 14,918,354 Bytes

Build module-info.json with this change:
Build time: 1m56.292s
File size: 15,577,031 Bytes

Bug: 132768299
Test: 1. Checkout the internal master branch
      2. Patch this CL
      3. m -j out/target/product/generic_x86_64/module-info.json
      4. Open the module-info.json
      5. For verifying soong_java_prebuilt.mk, check the classes.jar of
         module prebuilt-google-play-* exists.
         e.g.
         "prebuilt-google-play-...": {
              ...
              "classes_jar": [
	      	"out/target/common/obj/JAVA_LIBRARIES/
		 prebuilt-google-..._intermediates/classes.jar"
	      ]
         }
      5. For verifying java_prebuilt_internal.mk, check the classes.jar
         of module ink exists.
         e.g.
	 "ink": {
	     ...
	     "classes_jar": [
	     	"out/target/common/obj/JAVA_LIBRARIES/ink_intermediates/
		 classes.jar"
	     ]
	 }

Change-Id: I09518c92260db47d2686493fa13951f316159d13
This commit is contained in:
patricktu 2019-05-27 18:48:21 +08:00
parent 56bfae6402
commit 379f7f0ef6
3 changed files with 4 additions and 1 deletions

View File

@ -39,6 +39,8 @@ ifneq ($(filter $(LOCAL_MODULE),$(PRODUCT_BOOT_JARS)),)
$(call pretty-error,Modules in PRODUCT_BOOT_JARS must be defined in Android.bp files)
endif
ALL_MODULES.$(my_register_name).CLASSES_JAR := $(common_classes_jar)
#######################################
# defines built_odex along with rule to install odex
include $(BUILD_SYSTEM)/dex_preopt_odex_install.mk
@ -239,4 +241,3 @@ $(my_exported_sdk_libs_file):
endif # ! prebuilt_module_is_dex_javalib
endif # LOCAL_IS_HOST_MODULE is not set

View File

@ -128,6 +128,7 @@ my_built_installed := $(foreach f,$(LOCAL_SOONG_BUILT_INSTALLED),\
my_installed := $(call copy-many-files, $(my_built_installed))
ALL_MODULES.$(my_register_name).INSTALLED += $(my_installed)
ALL_MODULES.$(my_register_name).BUILT_INSTALLED += $(my_built_installed)
ALL_MODULES.$(my_register_name).CLASSES_JAR := $(full_classes_jar)
$(my_register_name): $(my_installed)
ifdef LOCAL_SOONG_AAR

View File

@ -18,6 +18,7 @@ $(MODULE_INFO_JSON):
'"dependencies": [$(foreach w,$(sort $(ALL_DEPS.$(m).ALL_DEPS)),"$(w)", )], ' \
'"srcs": [$(foreach w,$(sort $(ALL_MODULES.$(m).SRCS)),"$(w)", )], ' \
'"srcjars": [$(foreach w,$(sort $(ALL_MODULES.$(m).SRCJARS)),"$(w)", )], ' \
'"classes_jar": [$(foreach w,$(sort $(ALL_MODULES.$(m).CLASSES_JAR)),"$(w)", )], ' \
'},\n' \
) | sed -e 's/, *\]/]/g' -e 's/, *\}/ }/g' -e '$$s/,$$//' >> $@
$(hide) echo '}' >> $@