Build kzip for Go files in build/blueprint directory.

Bug: 137798757
Test: manual
Change-Id: If953425c80c60a64ebd6d50dddbac858ef091275
This commit is contained in:
Sasha Smundak 2020-01-14 17:01:03 -08:00
parent 1be2d48005
commit facb360e49

View file

@ -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; }