1# Print a list of the modules that could be built
2
3MODULE_INFO_JSON := $(PRODUCT_OUT)/module-info.json
4
5$(MODULE_INFO_JSON):
6	@echo Generating $@
7	$(hide) echo -ne '{\n ' > $@
8	$(hide) echo -ne $(foreach m, $(sort $(ALL_MODULES)), \
9		' "$(m)": {' \
10			'"class": [$(foreach w,$(sort $(ALL_MODULES.$(m).CLASS)),"$(w)", )], ' \
11			'"path": [$(foreach w,$(sort $(ALL_MODULES.$(m).PATH)),"$(w)", )], ' \
12			'"tags": [$(foreach w,$(sort $(ALL_MODULES.$(m).TAGS)),"$(w)", )], ' \
13			'"installed": [$(foreach w,$(sort $(ALL_MODULES.$(m).INSTALLED)),"$(w)", )], ' \
14			'"compatibility_suites": [$(foreach w,$(sort $(ALL_MODULES.$(m).COMPATIBILITY_SUITES)),"$(w)", )], ' \
15			'"auto_test_config": [$(ALL_MODULES.$(m).auto_test_config)], ' \
16			'"module_name": "$(ALL_MODULES.$(m).MODULE_NAME)", ' \
17			'"test_config": [$(foreach w,$(strip $(ALL_MODULES.$(m).TEST_CONFIG) $(ALL_MODULES.$(m).EXTRA_TEST_CONFIGS)),"$(w)", )], ' \
18			'"dependencies": [$(foreach w,$(sort $(ALL_DEPS.$(m).ALL_DEPS)),"$(w)", )], ' \
19			'"srcs": [$(foreach w,$(sort $(ALL_MODULES.$(m).SRCS)),"$(w)", )], ' \
20			'"srcjars": [$(foreach w,$(sort $(ALL_MODULES.$(m).SRCJARS)),"$(w)", )], ' \
21			'"classes_jar": [$(foreach w,$(sort $(ALL_MODULES.$(m).CLASSES_JAR)),"$(w)", )], ' \
22			'"test_mainline_modules": [$(foreach w,$(sort $(ALL_MODULES.$(m).TEST_MAINLINE_MODULES)),"$(w)", )], ' \
23			'"is_unit_test": "$(ALL_MODULES.$(m).IS_UNIT_TEST)", ' \
24			'},\n' \
25	 ) | sed -e 's/, *\]/]/g' -e 's/, *\}/ }/g' -e '$$s/,$$//' >> $@
26	$(hide) echo '}' >> $@
27
28
29droidcore-unbundled: $(MODULE_INFO_JSON)
30
31$(call dist-for-goals, general-tests, $(MODULE_INFO_JSON))
32$(call dist-for-goals, droidcore-unbundled, $(MODULE_INFO_JSON))
33