forked from bazel-contrib/bazel-gazelle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MODULE.bazel
77 lines (66 loc) · 2.47 KB
/
MODULE.bazel
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
module(
name = "gazelle",
version = "0.37.0",
repo_name = "bazel_gazelle",
)
bazel_dep(name = "bazel_features", version = "1.9.1")
bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "protobuf", version = "3.19.6", repo_name = "com_google_protobuf")
bazel_dep(name = "rules_go", version = "0.46.0", repo_name = "io_bazel_rules_go")
bazel_dep(name = "rules_proto", version = "4.0.0")
go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk")
# Known to exist since it is instantiated by rules_go itself.
use_repo(
go_sdk,
"go_host_compatible_sdk_label",
)
non_module_deps = use_extension("//internal/bzlmod:non_module_deps.bzl", "non_module_deps")
use_repo(
non_module_deps,
"bazel_gazelle_go_repository_cache",
"bazel_gazelle_go_repository_tools",
"bazel_gazelle_is_bazel_module",
)
go_deps = use_extension("//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")
# golang.org/x/tools is not a direct dependency of the go code anymore
# but bazel buildtools and nogo depend on it.
go_deps.module(
path = "golang.org/x/tools",
sum = "h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ=",
version = "v0.18.0",
)
use_repo(
go_deps,
"com_github_bazelbuild_buildtools",
"com_github_bmatcuk_doublestar_v4",
"com_github_fsnotify_fsnotify",
"com_github_google_go_cmp",
"com_github_pmezard_go_difflib",
"org_golang_x_mod",
"org_golang_x_sync",
"org_golang_x_tools",
"org_golang_x_tools_go_vcs",
# Referenced by `gazelle_binary`.
"bazel_gazelle_go_repository_config",
# Dependencies of rules_go that require special handling in go_deps.
"com_github_golang_protobuf",
"org_golang_google_protobuf",
)
bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.4.1", dev_dependency = True)
bazel_dep(name = "stardoc", version = "0.6.2", dev_dependency = True, repo_name = "io_bazel_stardoc")
go_sdk_dev = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk", dev_dependency = True)
go_sdk_dev.download(version = "1.22.4")
# Used by compatibility tests, keep as low as possible.
go_sdk_dev.download(version = "1.18.10")
# Known to exist since it is instantiated by rules_go itself.
use_repo(
go_sdk_dev,
go_sdk = "go_default_sdk",
)
# This will only apply in the root module. temporarily needed to fix `bazel_features` in CI.
single_version_override(
module_name = "rules_go",
patch_strip = 1,
patches = ["//third_party/patches:rules_go.patch"],
)