Joe Onorato | 48bd6f5 | 2016-04-06 14:48:30 -0700 | [diff] [blame] | 1 | # Print a list of the modules that could be built |
yangbill | fa5026c | 2022-02-08 16:59:21 +0800 | [diff] [blame] | 2 | # Currently runtime_dependencies only include the runtime libs information for cc binaries. |
Joe Onorato | 48bd6f5 | 2016-04-06 14:48:30 -0700 | [diff] [blame] | 3 | |
| 4 | MODULE_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 Cheng | 2260918 | 2017-11-28 15:04:40 -0800 | [diff] [blame] | 15 | '"compatibility_suites": [$(foreach w,$(sort $(ALL_MODULES.$(m).COMPATIBILITY_SUITES)),"$(w)", )], ' \ |
Dan Shi | efb892d | 2017-12-06 15:57:31 -0800 | [diff] [blame] | 16 | '"auto_test_config": [$(ALL_MODULES.$(m).auto_test_config)], ' \ |
yangbill | f90b734 | 2018-08-28 20:40:42 +0800 | [diff] [blame] | 17 | '"module_name": "$(ALL_MODULES.$(m).MODULE_NAME)", ' \ |
Dan Shi | cb49d99 | 2020-08-21 16:48:37 -0700 | [diff] [blame] | 18 | '"test_config": [$(foreach w,$(strip $(ALL_MODULES.$(m).TEST_CONFIG) $(ALL_MODULES.$(m).EXTRA_TEST_CONFIGS)),"$(w)", )], ' \ |
Brandon Lee | 5568c19 | 2018-09-12 17:39:32 +0800 | [diff] [blame] | 19 | '"dependencies": [$(foreach w,$(sort $(ALL_DEPS.$(m).ALL_DEPS)),"$(w)", )], ' \ |
yangbill | 5f5e236 | 2021-10-13 16:25:35 +0800 | [diff] [blame] | 20 | '"shared_libs": [$(foreach w,$(sort $(ALL_MODULES.$(m).SHARED_LIBS)),"$(w)", )], ' \ |
Devin Moore | 48d7b34 | 2023-05-15 18:08:30 +0000 | [diff] [blame] | 21 | '"static_libs": [$(foreach w,$(sort $(ALL_MODULES.$(m).STATIC_LIBS)),"$(w)", )], ' \ |
yangbill | 5f5e236 | 2021-10-13 16:25:35 +0800 | [diff] [blame] | 22 | '"system_shared_libs": [$(foreach w,$(sort $(ALL_MODULES.$(m).SYSTEM_SHARED_LIBS)),"$(w)", )], ' \ |
Brandon Lee | 5568c19 | 2018-09-12 17:39:32 +0800 | [diff] [blame] | 23 | '"srcs": [$(foreach w,$(sort $(ALL_MODULES.$(m).SRCS)),"$(w)", )], ' \ |
patricktu | ab435e3 | 2019-05-10 15:34:26 +0800 | [diff] [blame] | 24 | '"srcjars": [$(foreach w,$(sort $(ALL_MODULES.$(m).SRCJARS)),"$(w)", )], ' \ |
patricktu | 379f7f0 | 2019-05-27 18:48:21 +0800 | [diff] [blame] | 25 | '"classes_jar": [$(foreach w,$(sort $(ALL_MODULES.$(m).CLASSES_JAR)),"$(w)", )], ' \ |
kellyhung | 0ba6ec6 | 2020-08-28 00:19:53 +0800 | [diff] [blame] | 26 | '"test_mainline_modules": [$(foreach w,$(sort $(ALL_MODULES.$(m).TEST_MAINLINE_MODULES)),"$(w)", )], ' \ |
yangbill | 732b858 | 2021-01-08 17:36:56 +0800 | [diff] [blame] | 27 | '"is_unit_test": "$(ALL_MODULES.$(m).IS_UNIT_TEST)", ' \ |
Zhenhuang Wang | 415ee12 | 2022-08-05 20:51:50 +0800 | [diff] [blame] | 28 | '"test_options_tags": [$(foreach w,$(sort $(ALL_MODULES.$(m).TEST_OPTIONS_TAGS)),"$(w)", )], ' \ |
yangbill | 724565d | 2021-12-21 18:59:33 +0800 | [diff] [blame] | 29 | '"data": [$(foreach w,$(sort $(ALL_MODULES.$(m).TEST_DATA)),"$(w)", )], ' \ |
yangbill | fa5026c | 2022-02-08 16:59:21 +0800 | [diff] [blame] | 30 | '"runtime_dependencies": [$(foreach w,$(sort $(ALL_MODULES.$(m).LOCAL_RUNTIME_LIBRARIES)),"$(w)", )], ' \ |
Yike | 82f0a2d | 2022-08-31 17:46:13 +0800 | [diff] [blame] | 31 | '"static_dependencies": [$(foreach w,$(sort $(ALL_MODULES.$(m).LOCAL_STATIC_LIBRARIES)),"$(w)", )], ' \ |
yangbill | e6b498b | 2022-02-11 18:27:32 +0800 | [diff] [blame] | 32 | '"data_dependencies": [$(foreach w,$(sort $(ALL_MODULES.$(m).TEST_DATA_BINS)),"$(w)", )], ' \ |
yangbill | b2219c7 | 2022-02-18 15:27:53 +0800 | [diff] [blame] | 33 | '"supported_variants": [$(foreach w,$(sort $(ALL_MODULES.$(m).SUPPORTED_VARIANTS)),"$(w)", )], ' \ |
Yike | e4a5491 | 2022-06-27 16:43:23 +0800 | [diff] [blame] | 34 | '"host_dependencies": [$(foreach w,$(sort $(ALL_MODULES.$(m).HOST_REQUIRED_FROM_TARGET)),"$(w)", )], ' \ |
Yike | 450197e | 2022-09-19 16:02:48 +0800 | [diff] [blame] | 35 | '"target_dependencies": [$(foreach w,$(sort $(ALL_MODULES.$(m).TARGET_REQUIRED_FROM_HOST)),"$(w)", )], ' \ |
Joe Onorato | 48bd6f5 | 2016-04-06 14:48:30 -0700 | [diff] [blame] | 36 | '},\n' \ |
| 37 | ) | sed -e 's/, *\]/]/g' -e 's/, *\}/ }/g' -e '$$s/,$$//' >> $@ |
| 38 | $(hide) echo '}' >> $@ |
| 39 | |
| 40 | |
Bill Peckham | 16da01f | 2021-06-15 19:35:06 -0700 | [diff] [blame] | 41 | droidcore-unbundled: $(MODULE_INFO_JSON) |
Joe Onorato | 48bd6f5 | 2016-04-06 14:48:30 -0700 | [diff] [blame] | 42 | |
Simran Basi | 03f5253 | 2018-09-06 12:23:11 -0700 | [diff] [blame] | 43 | $(call dist-for-goals, general-tests, $(MODULE_INFO_JSON)) |
Bill Peckham | 16da01f | 2021-06-15 19:35:06 -0700 | [diff] [blame] | 44 | $(call dist-for-goals, droidcore-unbundled, $(MODULE_INFO_JSON)) |
Cole Faust | 5d825b7 | 2022-10-26 18:16:44 -0700 | [diff] [blame] | 45 | |
| 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))) |