Support build args in tools/maven/api.sh

You may want to pass arguments to the bazel build command line when
publishing, perhaps to debug output, or perhaps to add standalone flags
to avoid sandboxing on platforms where it is broken.

Change-Id: Ia1a9a50e7b833eea7299d9473dec87e4978b7803
This commit is contained in:
Martin Fick
2017-03-16 16:43:26 -06:00
parent 92e4362613
commit f070ef4352

View File

@@ -16,9 +16,9 @@
set -e
if [[ "$#" != "1" ]] ; then
if [[ "$#" -lt "1" ]] ; then
cat <<EOF
Usage: run "$0 COMMAND" from the top of your workspace,
Usage: run "$0 COMMAND [build_args...]" from the top of your workspace,
where COMMAND is one of
install
@@ -54,12 +54,13 @@ war_deploy)
exit 1
;;
esac
shift
if [[ "${VERBOSE:-x}" != "x" ]]; then
set -o xtrace
fi
bazel build //tools/maven:gen_${command} || \
bazel build //tools/maven:gen_${command} "$@" || \
{ echo "bazel failed to build gen_${command}. Use VERBOSE=1 for more info" ; exit 1 ; }
./bazel-genfiles/tools/maven/${command}.sh