Add command line tool that generates NOTICE.xml.gz for partitions.
The tool currently generates a XML file with the root element only and its content will be filled in in following CLs.
Also disable the generation of NOTICE.xml.gz in make when USE_SOONG_DEFINED_SYSTEM_IMAGE is true, so the Soong module could be used without conflict.
Bug: 330949782
Bug: 338342381
Test: lunch aosp_cf_x86_64_phone-trunk_staging-eng && m, and check that system/etc/NOTICE.xml.gz have all the XML elements.
Test: lunch aosp_cf_x86_64_phone_soong_system-trunk_staging-eng && m, and check that system/etc/NOTICE.xml.gz has root element only.
Change-Id: I82e90bd9aa3dabc605acfe8da697ab1f7e7ecf9b
diff --git a/core/Makefile b/core/Makefile
index b0392cd..0bc6f1f 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -1964,7 +1964,7 @@
installed_system_dlkm_notice_xml_gz := $(TARGET_OUT_SYSTEM_DLKM)/etc/NOTICE.xml.gz
ALL_INSTALLED_NOTICE_FILES := \
- $(installed_notice_html_or_xml_gz) \
+ $(if $(USE_SOONG_DEFINED_SYSTEM_IMAGE),,$(installed_notice_html_or_xml_gz)) \
$(installed_vendor_notice_xml_gz) \
$(installed_product_notice_xml_gz) \
$(installed_system_ext_notice_xml_gz) \
@@ -2051,7 +2051,9 @@
endif # PRODUCT_NOTICE_SPLIT
+ifneq ($(USE_SOONG_DEFINED_SYSTEM_IMAGE),true)
ALL_DEFAULT_INSTALLED_MODULES += $(installed_notice_html_or_xml_gz)
+endif
need_vendor_notice:=false
ifeq ($(BUILDING_VENDOR_BOOT_IMAGE),true)
diff --git a/core/os_licensing.mk b/core/os_licensing.mk
index 1e1b7df..d15a3d0 100644
--- a/core/os_licensing.mk
+++ b/core/os_licensing.mk
@@ -17,13 +17,17 @@
$(eval $(call text-notice-rule,$(target_notice_file_txt),"System image",$(system_notice_file_message),$(SYSTEM_NOTICE_DEPS),$(SYSTEM_NOTICE_DEPS)))
+ifneq ($(USE_SOONG_DEFINED_SYSTEM_IMAGE),true)
$(installed_notice_html_or_xml_gz): $(target_notice_file_xml_gz)
$(copy-file-to-target)
endif
+endif
$(call declare-1p-target,$(target_notice_file_xml_gz))
+ifneq ($(USE_SOONG_DEFINED_SYSTEM_IMAGE),true)
$(call declare-1p-target,$(installed_notice_html_or_xml_gz))
endif
+endif
.PHONY: vendorlicense
vendorlicense: $(call corresponding-license-metadata, $(VENDOR_NOTICE_DEPS)) reportmissinglicenses