Loading core/product_config.mk +10 −0 Original line number Diff line number Diff line Loading @@ -146,6 +146,11 @@ load_all_product_makefiles := true endif endif ifneq ($(ALLOW_RULES_IN_PRODUCT_CONFIG),) _product_config_saved_KATI_ALLOW_RULES := $(.KATI_ALLOW_RULES) .KATI_ALLOW_RULES := $(ALLOW_RULES_IN_PRODUCT_CONFIG) endif ifeq ($(load_all_product_makefiles),true) # Import all product makefiles. $(call import-products, $(all_product_makefiles)) Loading @@ -172,6 +177,11 @@ $(foreach makefile,$(ARTIFACT_PATH_REQUIREMENT_PRODUCTS),\ ) endif ifneq ($(ALLOW_RULES_IN_PRODUCT_CONFIG),) .KATI_ALLOW_RULES := $(_saved_KATI_ALLOW_RULES) _product_config_saved_KATI_ALLOW_RULES := endif ifneq ($(filter dump-products, $(MAKECMDGOALS)),) $(dump-products) endif Loading tools/product_config/src/com/android/build/config/OutputChecker.java +5 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,11 @@ public class OutputChecker { "PRODUCTS\\..*\\.PRODUCT_ENFORCE_PACKAGES_EXIST_ALLOW_LIST", // This is generated by this tool, but comes later in the make build system. "INTERNAL_PRODUCT"); "INTERNAL_PRODUCT", // This can be set temporarily by product_config.mk ".KATI_ALLOW_RULES" ); private final FlatConfig mConfig; private final TreeMap<String, Variable> mVariables; Loading tools/product_config/test.sh +34 −4 Original line number Diff line number Diff line Loading @@ -52,14 +52,16 @@ failed_baseline_checks= for product in $products ; do for variant in $variants ; do echo echo Checking to see if $product-$variant works with make TARGET_PRODUCT=$product TARGET_BUILD_VARIANT=$variant build/soong/soong_ui.bash --dumpvar-mode TARGET_PRODUCT &> /dev/null echo "Checking: lunch $product-$variant" TARGET_PRODUCT=$product \ TARGET_BUILD_VARIANT=$variant \ build/soong/soong_ui.bash --dumpvar-mode TARGET_PRODUCT &> /dev/null exit_status=$? if_signal_exit $exit_status if [ $exit_status -ne 0 ] ; then echo Combo fails with make, skipping product-config test run for $product-$variant echo "*** Combo fails with make, skipping product-config test run for $product-$variant" else echo Running product-config for $product-$variant rm -rf out/config/$product-$variant TARGET_PRODUCT=$product TARGET_BUILD_VARIANT=$variant product-config \ --ckati_bin $CKATI_BIN \ Loading @@ -69,6 +71,28 @@ for product in $products ; do if [ $exit_status -ne 0 ] ; then failed_baseline_checks="$failed_baseline_checks $product-$variant" fi if [ "$CHECK_FOR_RULES" != "" ] ; then # This is a little bit of sleight of hand for good output formatting at the # expense of speed. We've already run the command once without # ALLOW_RULES_IN_PRODUCT_CONFIG, so we know it passes there. We run it again # with ALLOW_RULES_IN_PRODUCT_CONFIG=error to see if it fails, but that will # cause it to only print the first error. But we want to see all of them, # so if it fails we run it a third time with ALLOW_RULES_IN_PRODUCT_CONFIG=warning, # so we can see all the warnings. TARGET_PRODUCT=$product \ TARGET_BUILD_VARIANT=$variant \ ALLOW_RULES_IN_PRODUCT_CONFIG=error \ build/soong/soong_ui.bash --dumpvar-mode TARGET_PRODUCT &> /dev/null exit_status=$? if_signal_exit $exit_status if [ $exit_status -ne 0 ] ; then TARGET_PRODUCT=$product \ TARGET_BUILD_VARIANT=$variant \ ALLOW_RULES_IN_PRODUCT_CONFIG=warning \ build/soong/soong_ui.bash --dumpvar-mode TARGET_PRODUCT > /dev/null failed_rule_checks="$failed_rule_checks $product-$variant" fi fi fi done done Loading @@ -88,3 +112,9 @@ for combo in $failed_baseline_checks ; do echo " ... $combo" done echo -n "Rules checks " if [ "$failed_rule_checks" = "" ] ; then echo PASSED ; else echo FAILED ; fi for combo in $failed_rule_checks ; do echo " ... $combo" done Loading
core/product_config.mk +10 −0 Original line number Diff line number Diff line Loading @@ -146,6 +146,11 @@ load_all_product_makefiles := true endif endif ifneq ($(ALLOW_RULES_IN_PRODUCT_CONFIG),) _product_config_saved_KATI_ALLOW_RULES := $(.KATI_ALLOW_RULES) .KATI_ALLOW_RULES := $(ALLOW_RULES_IN_PRODUCT_CONFIG) endif ifeq ($(load_all_product_makefiles),true) # Import all product makefiles. $(call import-products, $(all_product_makefiles)) Loading @@ -172,6 +177,11 @@ $(foreach makefile,$(ARTIFACT_PATH_REQUIREMENT_PRODUCTS),\ ) endif ifneq ($(ALLOW_RULES_IN_PRODUCT_CONFIG),) .KATI_ALLOW_RULES := $(_saved_KATI_ALLOW_RULES) _product_config_saved_KATI_ALLOW_RULES := endif ifneq ($(filter dump-products, $(MAKECMDGOALS)),) $(dump-products) endif Loading
tools/product_config/src/com/android/build/config/OutputChecker.java +5 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,11 @@ public class OutputChecker { "PRODUCTS\\..*\\.PRODUCT_ENFORCE_PACKAGES_EXIST_ALLOW_LIST", // This is generated by this tool, but comes later in the make build system. "INTERNAL_PRODUCT"); "INTERNAL_PRODUCT", // This can be set temporarily by product_config.mk ".KATI_ALLOW_RULES" ); private final FlatConfig mConfig; private final TreeMap<String, Variable> mVariables; Loading
tools/product_config/test.sh +34 −4 Original line number Diff line number Diff line Loading @@ -52,14 +52,16 @@ failed_baseline_checks= for product in $products ; do for variant in $variants ; do echo echo Checking to see if $product-$variant works with make TARGET_PRODUCT=$product TARGET_BUILD_VARIANT=$variant build/soong/soong_ui.bash --dumpvar-mode TARGET_PRODUCT &> /dev/null echo "Checking: lunch $product-$variant" TARGET_PRODUCT=$product \ TARGET_BUILD_VARIANT=$variant \ build/soong/soong_ui.bash --dumpvar-mode TARGET_PRODUCT &> /dev/null exit_status=$? if_signal_exit $exit_status if [ $exit_status -ne 0 ] ; then echo Combo fails with make, skipping product-config test run for $product-$variant echo "*** Combo fails with make, skipping product-config test run for $product-$variant" else echo Running product-config for $product-$variant rm -rf out/config/$product-$variant TARGET_PRODUCT=$product TARGET_BUILD_VARIANT=$variant product-config \ --ckati_bin $CKATI_BIN \ Loading @@ -69,6 +71,28 @@ for product in $products ; do if [ $exit_status -ne 0 ] ; then failed_baseline_checks="$failed_baseline_checks $product-$variant" fi if [ "$CHECK_FOR_RULES" != "" ] ; then # This is a little bit of sleight of hand for good output formatting at the # expense of speed. We've already run the command once without # ALLOW_RULES_IN_PRODUCT_CONFIG, so we know it passes there. We run it again # with ALLOW_RULES_IN_PRODUCT_CONFIG=error to see if it fails, but that will # cause it to only print the first error. But we want to see all of them, # so if it fails we run it a third time with ALLOW_RULES_IN_PRODUCT_CONFIG=warning, # so we can see all the warnings. TARGET_PRODUCT=$product \ TARGET_BUILD_VARIANT=$variant \ ALLOW_RULES_IN_PRODUCT_CONFIG=error \ build/soong/soong_ui.bash --dumpvar-mode TARGET_PRODUCT &> /dev/null exit_status=$? if_signal_exit $exit_status if [ $exit_status -ne 0 ] ; then TARGET_PRODUCT=$product \ TARGET_BUILD_VARIANT=$variant \ ALLOW_RULES_IN_PRODUCT_CONFIG=warning \ build/soong/soong_ui.bash --dumpvar-mode TARGET_PRODUCT > /dev/null failed_rule_checks="$failed_rule_checks $product-$variant" fi fi fi done done Loading @@ -88,3 +112,9 @@ for combo in $failed_baseline_checks ; do echo " ... $combo" done echo -n "Rules checks " if [ "$failed_rule_checks" = "" ] ; then echo PASSED ; else echo FAILED ; fi for combo in $failed_rule_checks ; do echo " ... $combo" done