blob: e83d4085773940183e28bc9256a496e72b30fe39 [file] [log] [blame]
Joe Onorato48bd6f52016-04-06 14:48:30 -07001# Print a list of the modules that could be built
yangbillfa5026c2022-02-08 16:59:21 +08002# Currently runtime_dependencies only include the runtime libs information for cc binaries.
Joe Onorato48bd6f52016-04-06 14:48:30 -07003
4MODULE_INFO_JSON := $(PRODUCT_OUT)/module-info.json
5
6$(MODULE_INFO_JSON):
7 @echo Generating $@
8 $(hide) echo -ne '{\n ' > $@
9 $(hide) echo -ne $(foreach m, $(sort $(ALL_MODULES)), \
10 ' "$(m)": {' \
11 '"class": [$(foreach w,$(sort $(ALL_MODULES.$(m).CLASS)),"$(w)", )], ' \
12 '"path": [$(foreach w,$(sort $(ALL_MODULES.$(m).PATH)),"$(w)", )], ' \
13 '"tags": [$(foreach w,$(sort $(ALL_MODULES.$(m).TAGS)),"$(w)", )], ' \
14 '"installed": [$(foreach w,$(sort $(ALL_MODULES.$(m).INSTALLED)),"$(w)", )], ' \
Kevin Cheng22609182017-11-28 15:04:40 -080015 '"compatibility_suites": [$(foreach w,$(sort $(ALL_MODULES.$(m).COMPATIBILITY_SUITES)),"$(w)", )], ' \
Dan Shiefb892d2017-12-06 15:57:31 -080016 '"auto_test_config": [$(ALL_MODULES.$(m).auto_test_config)], ' \
yangbillf90b7342018-08-28 20:40:42 +080017 '"module_name": "$(ALL_MODULES.$(m).MODULE_NAME)", ' \
Dan Shicb49d992020-08-21 16:48:37 -070018 '"test_config": [$(foreach w,$(strip $(ALL_MODULES.$(m).TEST_CONFIG) $(ALL_MODULES.$(m).EXTRA_TEST_CONFIGS)),"$(w)", )], ' \
Brandon Lee5568c192018-09-12 17:39:32 +080019 '"dependencies": [$(foreach w,$(sort $(ALL_DEPS.$(m).ALL_DEPS)),"$(w)", )], ' \
yangbill5f5e2362021-10-13 16:25:35 +080020 '"shared_libs": [$(foreach w,$(sort $(ALL_MODULES.$(m).SHARED_LIBS)),"$(w)", )], ' \
21 '"system_shared_libs": [$(foreach w,$(sort $(ALL_MODULES.$(m).SYSTEM_SHARED_LIBS)),"$(w)", )], ' \
Brandon Lee5568c192018-09-12 17:39:32 +080022 '"srcs": [$(foreach w,$(sort $(ALL_MODULES.$(m).SRCS)),"$(w)", )], ' \
patricktuab435e32019-05-10 15:34:26 +080023 '"srcjars": [$(foreach w,$(sort $(ALL_MODULES.$(m).SRCJARS)),"$(w)", )], ' \
patricktu379f7f02019-05-27 18:48:21 +080024 '"classes_jar": [$(foreach w,$(sort $(ALL_MODULES.$(m).CLASSES_JAR)),"$(w)", )], ' \
kellyhung0ba6ec62020-08-28 00:19:53 +080025 '"test_mainline_modules": [$(foreach w,$(sort $(ALL_MODULES.$(m).TEST_MAINLINE_MODULES)),"$(w)", )], ' \
yangbill732b8582021-01-08 17:36:56 +080026 '"is_unit_test": "$(ALL_MODULES.$(m).IS_UNIT_TEST)", ' \
Zhenhuang Wang415ee122022-08-05 20:51:50 +080027 '"test_options_tags": [$(foreach w,$(sort $(ALL_MODULES.$(m).TEST_OPTIONS_TAGS)),"$(w)", )], ' \
yangbill724565d2021-12-21 18:59:33 +080028 '"data": [$(foreach w,$(sort $(ALL_MODULES.$(m).TEST_DATA)),"$(w)", )], ' \
yangbillfa5026c2022-02-08 16:59:21 +080029 '"runtime_dependencies": [$(foreach w,$(sort $(ALL_MODULES.$(m).LOCAL_RUNTIME_LIBRARIES)),"$(w)", )], ' \
Yike82f0a2d2022-08-31 17:46:13 +080030 '"static_dependencies": [$(foreach w,$(sort $(ALL_MODULES.$(m).LOCAL_STATIC_LIBRARIES)),"$(w)", )], ' \
yangbille6b498b2022-02-11 18:27:32 +080031 '"data_dependencies": [$(foreach w,$(sort $(ALL_MODULES.$(m).TEST_DATA_BINS)),"$(w)", )], ' \
yangbillb2219c72022-02-18 15:27:53 +080032 '"supported_variants": [$(foreach w,$(sort $(ALL_MODULES.$(m).SUPPORTED_VARIANTS)),"$(w)", )], ' \
Yikee4a54912022-06-27 16:43:23 +080033 '"host_dependencies": [$(foreach w,$(sort $(ALL_MODULES.$(m).HOST_REQUIRED_FROM_TARGET)),"$(w)", )], ' \
Yike450197e2022-09-19 16:02:48 +080034 '"target_dependencies": [$(foreach w,$(sort $(ALL_MODULES.$(m).TARGET_REQUIRED_FROM_HOST)),"$(w)", )], ' \
Joe Onorato48bd6f52016-04-06 14:48:30 -070035 '},\n' \
36 ) | sed -e 's/, *\]/]/g' -e 's/, *\}/ }/g' -e '$$s/,$$//' >> $@
37 $(hide) echo '}' >> $@
38
39
Bill Peckham16da01f2021-06-15 19:35:06 -070040droidcore-unbundled: $(MODULE_INFO_JSON)
Joe Onorato48bd6f52016-04-06 14:48:30 -070041
Simran Basi03f52532018-09-06 12:23:11 -070042$(call dist-for-goals, general-tests, $(MODULE_INFO_JSON))
Bill Peckham16da01f2021-06-15 19:35:06 -070043$(call dist-for-goals, droidcore-unbundled, $(MODULE_INFO_JSON))
Cole Faust5d825b72022-10-26 18:16:44 -070044
45# On every build, generate an all_modules.txt file to be used for autocompleting
46# the m command. After timing this using $(shell date +"%s.%3N"), it only adds
47# 0.01 seconds to the internal master build, and will only rerun on builds that
48# rerun kati.
49$(file >$(PRODUCT_OUT)/all_modules.txt,$(subst $(space),$(newline),$(ALL_MODULES)))