From facb360e49b05cc244d6ef6bb8261f32f769dfe3 Mon Sep 17 00:00:00 2001 From: Sasha Smundak Date: Tue, 14 Jan 2020 17:01:03 -0800 Subject: [PATCH] Build kzip for Go files in build/blueprint directory. Bug: 137798757 Test: manual Change-Id: If953425c80c60a64ebd6d50dddbac858ef091275 --- build_kzip.bash | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/build_kzip.bash b/build_kzip.bash index 89cd067ba..329825a03 100755 --- a/build_kzip.bash +++ b/build_kzip.bash @@ -22,13 +22,14 @@ declare -r out="${OUT_DIR:-out}" build/soong/soong_ui.bash --build-mode --all-modules --dir=$PWD -k merge_zips xref_cxx xref_java #Build extraction file for Go files in build/soong directory. declare -r abspath_out=$(realpath "${out}") -(cd build/soong; - ../../prebuilts/build-tools/linux-x86/bin/go_extractor \ - --goroot="${PWD}/../../prebuilts/go/linux-x86" \ - --rules=vnames.go.json \ - --canonicalize_package_corpus \ - --output "${abspath_out}/soong/all.go.kzip" \ - ./... ) +declare -r go_extractor=$(realpath prebuilts/build-tools/linux-x86/bin/go_extractor) +declare -r go_root=$(realpath prebuilts/go/linux-x86) +for dir in blueprint soong; do + (cd "build/$dir"; + "$go_extractor" --goroot="$go_root" --rules=vnames.go.json --canonicalize_package_corpus \ + --output "${abspath_out}/soong/build_${dir}.go.kzip" ./... + ) +done declare -r kzip_count=$(find "$out" -name '*.kzip' | wc -l) (($kzip_count>100000)) || { printf "Too few kzip files were generated: %d\n" $kzip_count; exit 1; }