Enforce RROs for all the build-time ROs
This CL is to generate every static RRO package for its target package
automatically at build-time.
BOARD_ENFORCE_RRO build variable is added to specify whether enforcing
RRO is required or not.
BOARD_ENFORCE_RRO_EXEMPT_SOURCES build variable is added to specify
the module list of which item should be exempt from enforcing RRO.
Test: tested on bullhead and sailfish
Bug: 34097942
Change-Id: I455b2ce34e66c57a540c299b5e378b7c4e78d5b8
diff --git a/core/main.mk b/core/main.mk
index 9a39a5e..0e4af4f 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -519,6 +519,10 @@
ADDITIONAL_BUILD_PROPERTIES := $(strip $(ADDITIONAL_BUILD_PROPERTIES))
.KATI_READONLY := ADDITIONAL_BUILD_PROPERTIES
+ifeq ($(BOARD_ENFORCE_RRO),true)
+ENFORCE_RRO_SOURCES :=
+endif
+
ifneq ($(ONE_SHOT_MAKEFILE),)
# We've probably been invoked by the "mm" shell function
# with a subdirectory's makefile.
@@ -585,6 +589,13 @@
# All module makefiles have been included at this point.
# -------------------------------------------------------------------
+# -------------------------------------------------------------------
+# Enforce to generate all RRO packages for modules having resource
+# overlays.
+# -------------------------------------------------------------------
+ifeq ($(BOARD_ENFORCE_RRO),true)
+$(call generate_all_enforce_rro_packages)
+endif
# -------------------------------------------------------------------
# Fix up CUSTOM_MODULES to refer to installed files rather than