Add a "relaxed" mode for require-artifacts-in-path
This is useful when a makefile will produces different artifacts
depending on other configuration. Having an allow-list that's too strict
can make it a little difficult to make progress.
Test: m nothing in follow-up
Change-Id: Ic8235912bcbaa8e249a752e042d4f42be4466e34
(cherry picked from commit 0b6fde311ac6bc2b64e69858382117a362645502)
diff --git a/core/product.mk b/core/product.mk
index 9aebc28..f47e6f2 100644
--- a/core/product.mk
+++ b/core/product.mk
@@ -463,6 +463,13 @@
$(sort $(ARTIFACT_PATH_REQUIREMENT_PRODUCTS) $(current_mk)))
endef
+# Like require-artifacts-in-path, but does not require all allow-list entries to
+# have an effect.
+define require-artifacts-in-path-relaxed
+ $(require-artifacts-in-path) \
+ $(eval PRODUCTS.$(current_mk).ARTIFACT_PATH_REQUIREMENT_IS_RELAXED := true)
+endef
+
# Makes including non-existent modules in PRODUCT_PACKAGES an error.
# $(1): list of non-existent modules to allow.
define enforce-product-packages-exist