Merge "Build kzip for Go files in build/blueprint directory."

This commit is contained in:
Treehugger Robot 2020-01-17 07:58:43 +00:00 committed by Gerrit Code Review
commit 26691c094d
1 changed files with 8 additions and 7 deletions

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