diff options
author | Kristina Chodorow <kchodorow@google.com> | 2015-04-06 15:54:03 +0000 |
---|---|---|
committer | John Field <jfield@google.com> | 2015-04-06 18:48:41 +0000 |
commit | 06f446a697d9f0eefad3b5e5bf070a751e3c5efc (patch) | |
tree | 87c4129b95a28fffe55d8cc0ee80018b51e4a0a9 /compile.sh | |
parent | 9cc361cbab0427a27e39f92596083ebf5e20847e (diff) |
Update getting started instructions with .bazelrc strategy
--
MOS_MIGRATED_REVID=90418845
Diffstat (limited to 'compile.sh')
-rwxr-xr-x | compile.sh | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/compile.sh b/compile.sh index f7718ac6f4..39de894aa5 100755 --- a/compile.sh +++ b/compile.sh @@ -118,11 +118,6 @@ EOF esac } -# Create symlinks so we can use tools and examples from the base_workspace. -rm -f base_workspace/tools && ln -s "$(pwd)/tools" base_workspace/tools -rm -f base_workspace/third_party && ln -s "$(pwd)/third_party" base_workspace/third_party -rm -f base_workspace/examples && ln -s "$(pwd)/examples" base_workspace/examples - case "${PLATFORM}" in linux) # Sorry, no static linking on linux for now. @@ -477,4 +472,18 @@ create_deploy_jar "precomp_xcodegen_deploy" "com.google.devtools.build.xcode.xco cp -f output/actoolzip/precomp_actoolzip_deploy.jar output/ibtoolzip/precomp_ibtoolzip_deploy.jar output/momczip/precomp_momczip_deploy.jar output/bundlemerge/precomp_bundlemerge_deploy.jar output/plmerge/precomp_plmerge_deploy.jar output/xcodegen/precomp_xcodegen_deploy.jar tools/objc/ +# Create a bazelrc file with this directory in the package path. +package_path="build --package_path %workspace%:$(pwd)" +if [ ! -f $HOME/.bazelrc ]; then + log "Creating a .bazelrc pointing to this directory" + cat > $HOME/.bazelrc <<EOF +$package_path +EOF +else + warning="You already have a .bazelrc. please modify it to add $(pwd) " + warning="$warning to your build package path." + old_line=$(fgrep "build --package_path " ~/.bazelrc) || true + [[ $package_path != $old_line ]] && log "$warning" +fi + log "Build successful! Binary is here: ${PWD}/output/bazel" |