diff options
author | Lukacs Berki <lberki@google.com> | 2015-12-08 13:08:15 +0000 |
---|---|---|
committer | Lukacs Berki <lberki@google.com> | 2015-12-08 13:17:27 +0000 |
commit | fcb3f8468a9f949e243bf93c65e9b2e4f6565b9b (patch) | |
tree | f7c43f16abc90aea0ae27dea5146218c53859789 /scripts | |
parent | f9fdc8dfced8b2b14561720623126a91e04b22cb (diff) |
Make "//..." do not find packages in the base workspace.
This is a temporary hack until the base workspace goes away.
Fixes #652.
--
MOS_MIGRATED_REVID=109677574
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/bootstrap/init_workspace.sh | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/scripts/bootstrap/init_workspace.sh b/scripts/bootstrap/init_workspace.sh index 7e1544ee85..764d8bab45 100755 --- a/scripts/bootstrap/init_workspace.sh +++ b/scripts/bootstrap/init_workspace.sh @@ -18,12 +18,23 @@ # the tools directory. # Create symlinks so we can use tools and examples from the base_workspace. +function symlink_directory() { + local dir=$1 + rm -fr ${base_workspace}/${dir} + mkdir ${base_workspace}/${dir} + + for i in $(cd ${dir}; ls); do + ln -s $(pwd)/${dir}/$i ${base_workspace}/${dir}/$i; + done + + touch ${base_workspace}/${dir}/DONT_FOLLOW_SYMLINKS_WHEN_TRAVERSING_THIS_DIRECTORY_VIA_A_RECURSIVE_TARGET_PATTERN +} + base_workspace=${WORKSPACE_DIR}/base_workspace mkdir -p "$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" -rm -rf "${base_workspace}/src" +symlink_directory tools +symlink_directory examples +symlink_directory third_party # Create a bazelrc file with the base_workspace directory in the package path. bazelrc='build --package_path %workspace%:'${base_workspace} |