Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add bzlmod module file #4118

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/gtest-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
push:
pull_request:

env:
BAZEL_CXXOPTS: -std=c++14

jobs:
Linux:
runs-on: ubuntu-latest
Expand All @@ -19,6 +16,9 @@ jobs:
- name: Tests
run: bazel test --cxxopt=-std=c++14 --features=external_include_paths --test_output=errors ...

- name: Tests with bzlmod
run: bazel test --cxxopt=-std=c++14 --features=external_include_paths --test_output=errors --enable_bzlmod ...

macOS:
runs-on: macos-latest
steps:
Expand Down
10 changes: 10 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module(
name = "googletest",
compatibility_level = 1,
version = "0.0.0",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order not to have to maintain a version number multiple times (or at all), it seems to be a somewhat often used practice to have 0.0.0 here and just increment the version number in the bazel central registry.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version attribute is optional - maybe leave it out, instead of using 0.0.0

)

bazel_dep(name = "abseil-cpp", repo_name = "com_google_absl", version = "20210324.2")
bazel_dep(name = "platforms", version = "0.0.6")
bazel_dep(name = "rules_cc", version = "0.0.2")
bazel_dep(name = "rules_python", version = "0.12.0")
Empty file added WORKSPACE.bzlmod
Empty file.