blob: 66ba8f15ce4e5f9c8d4062dc2bdd5c53a6f6d9bf [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)", )], ' \
Devin Moore48d7b342023-05-15 18:08:30 +000021 '"static_libs": [$(foreach w,$(sort $(ALL_MODULES.$(m).STATIC_LIBS)),"$(w)", )], ' \
yangbill5f5e2362021-10-13 16:25:35 +080022 '"system_shared_libs": [$(foreach w,$(sort $(ALL_MODULES.$(m).SYSTEM_SHARED_LIBS)),"$(w)", )], ' \
Brandon Lee5568c192018-09-12 17:39:32 +080023 '"srcs": [$(foreach w,$(sort $(ALL_MODULES.$(m).SRCS)),"$(w)", )], ' \
patricktuab435e32019-05-10 15:34:26 +080024 '"srcjars": [$(foreach w,$(sort $(ALL_MODULES.$(m).SRCJARS)),"$(w)", )], ' \
patricktu379f7f02019-05-27 18:48:21 +080025 '"classes_jar": [$(foreach w,$(sort $(ALL_MODULES.$(m).CLASSES_JAR)),"$(w)", )], ' \
kellyhung0ba6ec62020-08-28 00:19:53 +080026 '"test_mainline_modules": [$(foreach w,$(sort $(ALL_MODULES.$(m).TEST_MAINLINE_MODULES)),"$(w)", )], ' \
yangbill732b8582021-01-08 17:36:56 +080027 '"is_unit_test": "$(ALL_MODULES.$(m).IS_UNIT_TEST)", ' \
Zhenhuang Wang415ee122022-08-05 20:51:50 +080028 '"test_options_tags": [$(foreach w,$(sort $(ALL_MODULES.$(m).TEST_OPTIONS_TAGS)),"$(w)", )], ' \
yangbill724565d2021-12-21 18:59:33 +080029 '"data": [$(foreach w,$(sort $(ALL_MODULES.$(m).TEST_DATA)),"$(w)", )], ' \
yangbillfa5026c2022-02-08 16:59:21 +080030 '"runtime_dependencies": [$(foreach w,$(sort $(ALL_MODULES.$(m).LOCAL_RUNTIME_LIBRARIES)),"$(w)", )], ' \
Yike82f0a2d2022-08-31 17:46:13 +080031 '"static_dependencies": [$(foreach w,$(sort $(ALL_MODULES.$(m).LOCAL_STATIC_LIBRARIES)),"$(w)", )], ' \
yangbille6b498b2022-02-11 18:27:32 +080032 '"data_dependencies": [$(foreach w,$(sort $(ALL_MODULES.$(m).TEST_DATA_BINS)),"$(w)", )], ' \
yangbillb2219c72022-02-18 15:27:53 +080033 '"supported_variants": [$(foreach w,$(sort $(ALL_MODULES.$(m).SUPPORTED_VARIANTS)),"$(w)", )], ' \
Yikee4a54912022-06-27 16:43:23 +080034 '"host_dependencies": [$(foreach w,$(sort $(ALL_MODULES.$(m).HOST_REQUIRED_FROM_TARGET)),"$(w)", )], ' \
Yike450197e2022-09-19 16:02:48 +080035 '"target_dependencies": [$(foreach w,$(sort $(ALL_MODULES.$(m).TARGET_REQUIRED_FROM_HOST)),"$(w)", )], ' \
Joe Onorato48bd6f52016-04-06 14:48:30 -070036 '},\n' \
37 ) | sed -e 's/, *\]/]/g' -e 's/, *\}/ }/g' -e '$$s/,$$//' >> $@
38 $(hide) echo '}' >> $@
39
40
Bill Peckham16da01f2021-06-15 19:35:06 -070041droidcore-unbundled: $(MODULE_INFO_JSON)
Joe Onorato48bd6f52016-04-06 14:48:30 -070042
Simran Basi03f52532018-09-06 12:23:11 -070043$(call dist-for-goals, general-tests, $(MODULE_INFO_JSON))
Bill Peckham16da01f2021-06-15 19:35:06 -070044$(call dist-for-goals, droidcore-unbundled, $(MODULE_INFO_JSON))
Cole Faust5d825b72022-10-26 18:16:44 -070045
46# On every build, generate an all_modules.txt file to be used for autocompleting
47# the m command. After timing this using $(shell date +"%s.%3N"), it only adds
48# 0.01 seconds to the internal master build, and will only rerun on builds that
49# rerun kati.
50$(file >$(PRODUCT_OUT)/all_modules.txt,$(subst $(space),$(newline),$(ALL_MODULES)))