From 289f6e10be2d6771fcb2d957d6a20001bd5aea05 Mon Sep 17 00:00:00 2001 From: Bob Badour Date: Wed, 9 Mar 2022 13:38:37 -0800 Subject: [PATCH] Handle symlink license metadata. Add target to force-build all license metadata. Bug: 68860345 Bug: 151177513 Bug: 151953481 Bug: 213388645 Bug: 210912771 Test: m alllicensemetadata reportmissinglicenses Change-Id: Iab3a41a232438e857d23674e0e1230d4d0336466 --- core/definitions.mk | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/core/definitions.mk b/core/definitions.mk index 314ba0a261..2d16fdf49e 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -902,6 +902,18 @@ reportallnoticelibrarynames: $(_all) $(COMPLIANCENOTICE_SHIPPEDLIBS) @$$(PRIVATE_LIST_FILE) endef +########################################################### +# Declares the rule to build all license metadata. +########################################################### +define build-all-license-metadata-rule +$(strip $(eval _all := $(call all-license-metadata))) + +.PHONY: alllicensemetadata +alllicensemetadata: $(_all) + @echo Building all $(words $(_all)) license metadata files +endef + + ########################################################### ## Declares a license metadata build rule for ALL_MODULES ########################################################### @@ -917,7 +929,8 @@ $(strip \ $(foreach t,$(sort $(ALL_NON_MODULES)),$(eval $(call non-module-license-metadata-rule,$(t)))) \ $(foreach m,$(sort $(ALL_MODULES)),$(eval $(call license-metadata-rule,$(m)))) \ $(eval $(call report-missing-licenses-rule)) \ - $(eval $(call report-all-notice-library-names-rule))) + $(eval $(call report-all-notice-library-names-rule)) \ + $(eval $(call build-all-license-metadata-rule))) endef ########################################################### @@ -3061,6 +3074,8 @@ endef # $(3): full path to destination define symlink-file $(eval $(_symlink-file)) +$(eval $(call declare-license-metadata,$(3),,,,,,)) +$(eval $(call declare-license-deps,$(3),$(1))) endef define _symlink-file