-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMODULE.bazel
More file actions
58 lines (48 loc) · 2 KB
/
MODULE.bazel
File metadata and controls
58 lines (48 loc) · 2 KB
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
# Listed first so its protoc toolchain wins resolution over the protobuf module's,
# which is pulled in transitively by rules_go/rules_proto.
bazel_dep(name = "toolchains_protoc", version = "0.6.1")
bazel_dep(name = "rules_go", version = "0.57.0")
bazel_dep(name = "gazelle", version = "0.45.0")
bazel_dep(name = "rules_proto", version = "7.1.0")
# Use a prebuilt protoc binary instead of compiling protoc (and its abseil/upb
# dependencies) from source on every cold build. Requires
# --incompatible_enable_proto_toolchain_resolution (set in .bazelrc).
protoc = use_extension("@toolchains_protoc//protoc:extensions.bzl", "protoc")
use_repo(protoc, "toolchains_protoc_hub")
register_toolchains("@toolchains_protoc_hub//:all")
GO_VERSION = "1.24.5"
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
# Download an SDK for the host OS & architecture as well as common remote execution
# platforms, using the version given from the `go.mod` file.
go_sdk.from_file(go_mod = "//:go.mod")
# Download an SDK for the host OS & architecture as well as common remote execution
# platforms, with a specific version.
go_sdk.download(version = GO_VERSION)
# Alternatively, download an SDK for a fixed OS/architecture.
go_sdk.download(
goarch = "amd64",
goos = "linux",
version = GO_VERSION,
)
# Another alternative is to register the Go SDK installed on the host (see the nota bene below).
go_sdk.host()
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")
# All *direct* Go dependencies of the module have to be listed explicitly
use_repo(
go_deps,
"com_github_data_dog_go_sqlmock",
"com_github_go_sql_driver_mysql",
"com_github_gogo_protobuf",
"com_github_spf13_cobra",
"com_github_stretchr_testify",
"com_github_uber_go_tally_v4",
"in_gopkg_yaml_v3",
"org_golang_google_grpc",
"org_golang_google_protobuf",
"org_golang_x_oauth2",
"org_uber_go_fx",
"org_uber_go_mock",
"org_uber_go_yarpc",
"org_uber_go_zap",
)