From 4c364620ac81a01dc2c9d6aac7cad3e4dbc6b52b Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Mon, 16 May 2016 01:35:57 -0700 Subject: [PATCH] Add tool to run kati for all products Test: get_build_var all_named_products Test: build/tools/kati_all_products.sh Change-Id: I3496cb4c59a1edb11c9149b95ecabd3a828b8972 --- core/product_config.mk | 4 ++++ tools/kati_all_products.sh | 7 +++++++ 2 files changed, 11 insertions(+) create mode 100755 tools/kati_all_products.sh diff --git a/core/product_config.mk b/core/product_config.mk index 0d4ced320..3b8c0eb11 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -189,6 +189,8 @@ else all_product_configs := $(get-all-product-makefiles) endif +all_named_products := + # Find the product config makefile for the current product. # all_product_configs consists items like: # : @@ -202,9 +204,11 @@ $(foreach f, $(all_product_configs),\ $(eval _cpm_word2 := $(word 2,$(_cpm_words)))\ $(if $(_cpm_word2),\ $(eval all_product_makefiles += $(_cpm_word2))\ + $(eval all_named_products += $(_cpm_word2))\ $(if $(filter $(TARGET_PRODUCT),$(_cpm_word1)),\ $(eval current_product_makefile += $(_cpm_word2)),),\ $(eval all_product_makefiles += $(f))\ + $(eval all_named_products += $(basename $(notdir $(f))))\ $(if $(filter $(TARGET_PRODUCT),$(basename $(notdir $(f)))),\ $(eval current_product_makefile += $(f)),))) _cpm_words := diff --git a/tools/kati_all_products.sh b/tools/kati_all_products.sh new file mode 100755 index 000000000..4567dbda2 --- /dev/null +++ b/tools/kati_all_products.sh @@ -0,0 +1,7 @@ +#!/bin/bash -e + +cd $ANDROID_BUILD_TOP +mkdir -p out.kati +source build/envsetup.sh + +get_build_var all_named_products | sed "s/ /\n/g" | parallel "$@" --progress "(source build/envsetup.sh; lunch {}-eng && m -j OUT_DIR=out.kati/{} out.kati/{}/build-{}.ninja) >out.kati/log.{} 2>&1" -- 2.11.0