aboutsummaryrefslogtreecommitdiff
path: root/tests/bcr/MODULE.bazel
blob: b774feb49b182c4318e46e3ad10d9b208e3b5a5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
module(
    name = "rules_go_bcr_tests",
    # Test that the default SDK is registered by not registering one from the test module.
    version = "1.2.3",
)

# Keep this dep first so that its toolchain takes precedence over the default SDK registered by
# rules_go.
bazel_dep(name = "other_module", version = "")
local_path_override(
    module_name = "other_module",
    path = "other_module",
)

bazel_dep(name = "rules_go", version = "", repo_name = "my_rules_go")
local_path_override(
    module_name = "rules_go",
    path = "../..",
)

bazel_dep(name = "gazelle", version = "0.26.0")
bazel_dep(name = "protobuf", version = "3.19.6")

go_sdk = use_extension("@my_rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(version = "1.19.5")

# Request an invalid SDK to verify that it isn't fetched since the first tag takes precedence.
go_sdk.host(version = "3.0.0")

# Bring the default SDK into scope to verify that it exists.
use_repo(go_sdk, "go_default_sdk")

# Bring the selected host compatible SDK into scope to verify that it exists.
use_repo(go_sdk, "go_host_compatible_sdk_label")

go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.module(
    path = "google.golang.org/grpc",
    sum = "h1:fPVVDxY9w++VjTZsYvXWqEf9Rqar/e+9zYfxKK+W+YU=",
    version = "v1.50.0",
)
use_repo(go_deps, "org_golang_google_grpc")