Skip to content

Commit

Permalink
Generate gitignored bazelrc with version-specific flags
Browse files Browse the repository at this point in the history
  • Loading branch information
BalestraPatrick committed Jan 9, 2023
1 parent 39f1ac7 commit a75dfff
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
# Symlink to `$DEVELOPER_DIR/Toolchains/XcodeDefault.xctoolchain/usr/lib`
**/*.xcodeproj/rules_xcodeproj/lib

generated.bazelrc
user.bazelrc
3 changes: 3 additions & 0 deletions bazel_6.bazelrc
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
build:cache --experimental_remote_build_event_upload=minimal

# Enable bzlmod under Bazel 6.
common --experimental_enable_bzlmod
3 changes: 3 additions & 0 deletions shared.bazelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Import Bazel version-specific bazelrc.
import %workspace%/generated.bazelrc

build --incompatible_disallow_empty_glob
build --experimental_convenience_symlinks=ignore
build --features=swift.use_global_module_cache
Expand Down
4 changes: 3 additions & 1 deletion tools/bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ else
readonly bazel_version_bazelrc="$root_dir/bazel_6.bazelrc"
fi

exec "$BAZEL_REAL" "--bazelrc=$bazel_version_bazelrc" "$@"
echo "import $bazel_version_bazelrc" > "generated.bazelrc"

exec "$BAZEL_REAL" "$@"

0 comments on commit a75dfff

Please sign in to comment.