Merge "Include following files in the SBOM of layoutlib, which are disted in Soong." into main am: 581b781ac4

Original change: https://android-review.googlesource.com/c/platform/build/+/2809912

Change-Id: I28c66a4dc0364bcb763591a90aae2f384f46c307
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Wei Li
2023-11-02 22:49:52 +00:00
committed by Automerger Merge Worker

View File

@@ -87,6 +87,15 @@ LAYOUTLIB_SBOM := $(call intermediates-dir-for,PACKAGING,layoutlib-sbom,HOST)
_layoutlib_font_config_files := $(sort $(wildcard frameworks/base/data/fonts/*.xml))
_layoutlib_fonts_files := $(filter $(TARGET_OUT)/fonts/%.ttf $(TARGET_OUT)/fonts/%.ttc $(TARGET_OUT)/fonts/%.otf, $(INTERNAL_SYSTEMIMAGE_FILES))
_layoutlib_keyboard_files := $(sort $(wildcard frameworks/base/data/keyboards/*.kcm))
# Find out files disted with layoutlib in Soong.
### Filter out static libraries for Windows and files already handled in make.
_layoutlib_filter_out_disted := $(addprefix layoutlib_native/,fonts/% keyboards/% build.prop res.zip windows/%.a)
_layoutlib_files_disted_by_soong := \
$(strip \
$(foreach p,$(_all_dist_src_dst_pairs), \
$(if $(filter-out $(_layoutlib_filter_out_disted),$(filter layoutlib_native/% layoutlib.jar,$(call word-colon,2,$p))),$p)))
$(LAYOUTLIB_SBOM)/sbom-metadata.csv:
rm -rf $@
echo installed_file,module_path,soong_module_type,is_prebuilt_make_module,product_copy_files,kernel_module_copy_files,is_platform_generated,build_output_path,static_libraries,whole_static_libraries,is_static_lib >> $@
@@ -107,6 +116,17 @@ $(LAYOUTLIB_SBOM)/sbom-metadata.csv:
echo data/keyboards/$(notdir $f),frameworks/base/data/keyboards,prebuilt_etc,,,,,$f,,, >> $@; \
)
$(foreach f,$(_layoutlib_files_disted_by_soong), \
$(eval _prebuilt_module_file := $(call word-colon,1,$f)) \
$(eval _dist_file := $(call word-colon,2,$f)) \
$(eval _dist_file := $(patsubst data/windows/%,data/win/lib64/%,$(patsubst layoutlib_native/%,data/%,$(_dist_file)))) \
$(eval _dist_file := $(subst layoutlib.jar,data/layoutlib.jar,$(_dist_file))) \
$(eval _module_name := $(strip $(foreach m,$(ALL_MODULES),$(if $(filter $(_prebuilt_module_file),$(ALL_MODULES.$m.CHECKED)),$m)))) \
$(eval _module_path := $(strip $(sort $(ALL_MODULES.$(_module_name).PATH)))) \
$(eval _soong_module_type := $(strip $(sort $(ALL_MODULES.$(_module_name).SOONG_MODULE_TYPE)))) \
echo $(patsubst layoutlib_native/%,%,$(_dist_file)),$(_module_path),$(_soong_module_type),,,,,$(_prebuilt_module_file),,, >> $@; \
)
$(foreach f,$(LAYOUTLIB_RES_FILES), \
$(eval _path := $(subst frameworks/base/core/res,data,$f)) \
echo $(_path),,,,,,Y,$f,,, >> $@; \