aboutsummaryrefslogtreecommitdiffhomepage
path: root/compile.sh
diff options
context:
space:
mode:
authorGravatar Kristina Chodorow <kchodorow@google.com>2016-01-27 16:33:26 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2016-01-28 15:29:42 +0000
commit14cf67863d56bab1eef11687a881adf323ba55ad (patch)
treeacf024ac579bf9f42d8fa935ed3b962aea4c0711 /compile.sh
parentdcb4a384e07c7224afe6d660fd845b55d6c55c86 (diff)
*** Reason for rollback *** Prerequisite for rolling back j2objc base workspace change *** Original change description *** Remove base_workspace from bazel setup I also removed a couple places the documentation referred to it incorrectly. There are still a couple of blog posts that mention it, but that seemed okay. RELNOTES: A bazelrc with --package_path set is no longer required for Bazel to find its tools. This also means that building //... should work to build everything in the workspace without including Bazel's own targets. -- MOS_MIGRATED_REVID=113164089
Diffstat (limited to 'compile.sh')
-rwxr-xr-xcompile.sh25
1 files changed, 19 insertions, 6 deletions
diff --git a/compile.sh b/compile.sh
index 9f435e0b2b..1cc6ecf545 100755
--- a/compile.sh
+++ b/compile.sh
@@ -27,26 +27,30 @@ cd "$(dirname "$0")"
source scripts/bootstrap/buildenv.sh
function usage() {
- [ -n "${1:-compile}" ] && echo "Invalid command(s): $1" >&2
+ [ -n "${1:-build}" ] && echo "Invalid command(s): $1" >&2
echo "syntax: $0 [command[,command]* [BAZEL_BIN [BAZEL_SUM]]]" >&2
echo " General purpose commands:" >&2
- echo " compile = compile the bazel binary (default)" >&2
+ echo " build = compile,init (default)" >&2
+ echo " compile = compile a Bazel binary for usage" >&2
+ echo " init = initialize the base workspace" >&2
echo " Commands for developers:" >&2
- echo " all = compile,determinism,test" >&2
+ echo " all = build,determinism,test" >&2
echo " determinism = test for stability of Bazel builds" >&2
echo " test = run the full test suite of Bazel" >&2
exit 1
}
function parse_options() {
- local keywords="(compile|all|determinism|bootstrap|test)"
- COMMANDS="${1:-compile}"
+ local keywords="(build|compile|init|all|determinism|bootstrap|test)"
+ COMMANDS="${1:-build}"
[[ "${COMMANDS}" =~ ^$keywords(,$keywords)*$ ]] || usage "$@"
DO_COMPILE=
DO_CHECKSUM=
DO_FULL_CHECKSUM=1
DO_TESTS=
- [[ "${COMMANDS}" =~ (compile|all) ]] && DO_COMPILE=1
+ DO_BASE_WORKSPACE_INIT=
+ [[ "${COMMANDS}" =~ (compile|build|all) ]] && DO_COMPILE=1
+ [[ "${COMMANDS}" =~ (init|build|all) ]] && DO_BASE_WORKSPACE_INIT=1
[[ "${COMMANDS}" =~ (bootstrap|determinism|all) ]] && DO_CHECKSUM=1
[[ "${COMMANDS}" =~ (bootstrap) ]] && DO_FULL_CHECKSUM=
[[ "${COMMANDS}" =~ (test|all) ]] && DO_TESTS=1
@@ -155,5 +159,14 @@ if [ $DO_TESTS ]; then
|| fail "Tests failed"
fi
+#
+# Setup the base workspace
+#
+if [ $DO_BASE_WORKSPACE_INIT ]; then
+ new_step 'Setting up base workspace'
+ display "."
+ source scripts/bootstrap/init_workspace.sh
+fi
+
clear_log
display "Build successful! Binary is here: ${BAZEL}"