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 |
LaMont Jones | edc62e8 | 2023-06-02 21:56:24 +0000 | [diff] [blame^] | 5 | COMMA := , |
| 6 | _SEP := $(COMMA) $(EMPTY) |
| 7 | _NEWLINE := '\n' |
Joe Onorato | 48bd6f5 | 2016-04-06 14:48:30 -0700 | [diff] [blame] | 8 | |
| 9 | $(MODULE_INFO_JSON): |
| 10 | @echo Generating $@ |
| 11 | $(hide) echo -ne '{\n ' > $@ |
LaMont Jones | edc62e8 | 2023-06-02 21:56:24 +0000 | [diff] [blame^] | 12 | $(hide) echo -ne $(KATI_foreach_sep m,$(COMMA)$(_NEWLINE) , $(sort $(ALL_MODULES)), \ |
Joe Onorato | 48bd6f5 | 2016-04-06 14:48:30 -0700 | [diff] [blame] | 13 | ' "$(m)": {' \ |
LaMont Jones | edc62e8 | 2023-06-02 21:56:24 +0000 | [diff] [blame^] | 14 | '"class": [$(KATI_foreach_sep w,$(_SEP),$(sort $(ALL_MODULES.$(m).CLASS)),"$(w)")], ' \ |
| 15 | '"path": [$(KATI_foreach_sep w,$(_SEP),$(sort $(ALL_MODULES.$(m).PATH)),"$(w)")], ' \ |
| 16 | '"tags": [$(KATI_foreach_sep w,$(_SEP),$(sort $(ALL_MODULES.$(m).TAGS)),"$(w)")], ' \ |
| 17 | '"installed": [$(KATI_foreach_sep w,$(_SEP),$(sort $(ALL_MODULES.$(m).INSTALLED)),"$(w)")], ' \ |
| 18 | '"compatibility_suites": [$(KATI_foreach_sep w,$(_SEP),$(sort $(ALL_MODULES.$(m).COMPATIBILITY_SUITES)),"$(w)")], ' \ |
Dan Shi | efb892d | 2017-12-06 15:57:31 -0800 | [diff] [blame] | 19 | '"auto_test_config": [$(ALL_MODULES.$(m).auto_test_config)], ' \ |
LaMont Jones | edc62e8 | 2023-06-02 21:56:24 +0000 | [diff] [blame^] | 20 | '"module_name": "$(ALL_MODULES.$(m).MODULE_NAME)"$(COMMA) ' \ |
| 21 | '"test_config": [$(KATI_foreach_sep w,$(_SEP),$(strip $(ALL_MODULES.$(m).TEST_CONFIG) $(ALL_MODULES.$(m).EXTRA_TEST_CONFIGS)),"$(w)")], ' \ |
| 22 | '"dependencies": [$(KATI_foreach_sep w,$(_SEP),$(sort $(ALL_DEPS.$(m).ALL_DEPS)),"$(w)")], ' \ |
| 23 | '"shared_libs": [$(KATI_foreach_sep w,$(_SEP),$(sort $(ALL_MODULES.$(m).SHARED_LIBS)),"$(w)")], ' \ |
| 24 | '"static_libs": [$(KATI_foreach_sep w,$(_SEP),$(sort $(ALL_MODULES.$(m).STATIC_LIBS)),"$(w)")], ' \ |
| 25 | '"system_shared_libs": [$(KATI_foreach_sep w,$(_SEP),$(sort $(ALL_MODULES.$(m).SYSTEM_SHARED_LIBS)),"$(w)")], ' \ |
| 26 | '"srcs": [$(KATI_foreach_sep w,$(_SEP),$(sort $(ALL_MODULES.$(m).SRCS)),"$(w)")], ' \ |
| 27 | '"srcjars": [$(KATI_foreach_sep w,$(_SEP),$(sort $(ALL_MODULES.$(m).SRCJARS)),"$(w)")], ' \ |
| 28 | '"classes_jar": [$(KATI_foreach_sep w,$(_SEP),$(sort $(ALL_MODULES.$(m).CLASSES_JAR)),"$(w)")], ' \ |
| 29 | '"test_mainline_modules": [$(KATI_foreach_sep w,$(_SEP),$(sort $(ALL_MODULES.$(m).TEST_MAINLINE_MODULES)),"$(w)")], ' \ |
| 30 | '"is_unit_test": "$(ALL_MODULES.$(m).IS_UNIT_TEST)"$(COMMA) ' \ |
| 31 | '"test_options_tags": [$(KATI_foreach_sep w,$(_SEP),$(sort $(ALL_MODULES.$(m).TEST_OPTIONS_TAGS)),"$(w)")], ' \ |
| 32 | '"data": [$(KATI_foreach_sep w,$(_SEP),$(sort $(ALL_MODULES.$(m).TEST_DATA)),"$(w)")], ' \ |
| 33 | '"runtime_dependencies": [$(KATI_foreach_sep w,$(_SEP),$(sort $(ALL_MODULES.$(m).LOCAL_RUNTIME_LIBRARIES)),"$(w)")], ' \ |
| 34 | '"static_dependencies": [$(KATI_foreach_sep w,$(_SEP),$(sort $(ALL_MODULES.$(m).LOCAL_STATIC_LIBRARIES)),"$(w)")], ' \ |
| 35 | '"data_dependencies": [$(KATI_foreach_sep w,$(_SEP),$(sort $(ALL_MODULES.$(m).TEST_DATA_BINS)),"$(w)")], ' \ |
| 36 | '"supported_variants": [$(KATI_foreach_sep w,$(_SEP),$(sort $(ALL_MODULES.$(m).SUPPORTED_VARIANTS)),"$(w)")], ' \ |
| 37 | '"host_dependencies": [$(KATI_foreach_sep w,$(_SEP),$(sort $(ALL_MODULES.$(m).HOST_REQUIRED_FROM_TARGET)),"$(w)")], ' \ |
| 38 | '"target_dependencies": [$(KATI_foreach_sep w,$(_SEP),$(sort $(ALL_MODULES.$(m).TARGET_REQUIRED_FROM_HOST)),"$(w)")]' \ |
| 39 | '}')'\n}\n' >> $@ |
Joe Onorato | 48bd6f5 | 2016-04-06 14:48:30 -0700 | [diff] [blame] | 40 | |
| 41 | |
Bill Peckham | 16da01f | 2021-06-15 19:35:06 -0700 | [diff] [blame] | 42 | droidcore-unbundled: $(MODULE_INFO_JSON) |
Joe Onorato | 48bd6f5 | 2016-04-06 14:48:30 -0700 | [diff] [blame] | 43 | |
Simran Basi | 03f5253 | 2018-09-06 12:23:11 -0700 | [diff] [blame] | 44 | $(call dist-for-goals, general-tests, $(MODULE_INFO_JSON)) |
Bill Peckham | 16da01f | 2021-06-15 19:35:06 -0700 | [diff] [blame] | 45 | $(call dist-for-goals, droidcore-unbundled, $(MODULE_INFO_JSON)) |
Cole Faust | 5d825b7 | 2022-10-26 18:16:44 -0700 | [diff] [blame] | 46 | |
| 47 | # On every build, generate an all_modules.txt file to be used for autocompleting |
| 48 | # the m command. After timing this using $(shell date +"%s.%3N"), it only adds |
| 49 | # 0.01 seconds to the internal master build, and will only rerun on builds that |
| 50 | # rerun kati. |
| 51 | $(file >$(PRODUCT_OUT)/all_modules.txt,$(subst $(space),$(newline),$(ALL_MODULES))) |