Skip to content

Commit

Permalink
Use org_golang_x_tools as module extension (#5043)
Browse files Browse the repository at this point in the history
  • Loading branch information
mering authored Dec 10, 2024
1 parent 79c938c commit 5e3fd79
Show file tree
Hide file tree
Showing 3 changed files with 174 additions and 27 deletions.
7 changes: 6 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ go_deps.module(
sum = "h1:BRlRwQ/4rd608QvjsM9HSzBLLM1nXyzHaDzdkBAyDKk=",
version = "v7.3.1",
)
go_deps.module(
path = "golang.org/x/tools",
sum = "h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg=",
version = "v0.21.1-0.20240508182429-e35e4ccd0d2d",
)
use_repo(
go_deps,
"com_github_antihax_optional",
Expand All @@ -59,11 +64,11 @@ use_repo(
"org_golang_google_protobuf",
"org_golang_x_oauth2",
"org_golang_x_text",
"org_golang_x_tools",
)

non_module_deps = use_extension(":non_module_deps.bzl", "non_module_deps")
use_repo(
non_module_deps,
"com_github_bazelbuild_buildtools",
"org_golang_x_tools",
)
187 changes: 168 additions & 19 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions non_module_deps.bzl
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
"""Module extension for non-module dependencies."""

load("@bazel_gazelle//:deps.bzl", "go_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

def _non_module_deps_impl(
# buildifier: disable=unused-variable
mctx):
# TODO(bazelbuild/buildtools#1204): Remove when available as module.
go_repository(
name = "org_golang_x_tools",
importpath = "golang.org/x/tools",
sum = "h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg=",
version = "v0.21.1-0.20240508182429-e35e4ccd0d2d",
)
http_archive(
name = "com_github_bazelbuild_buildtools",
sha256 = "051951c10ff8addeb4f10be3b0cf474b304b2ccd675f2cc7683cdd9010320ca9",
Expand Down

0 comments on commit 5e3fd79

Please sign in to comment.