diff --git a/BUILD.bazel b/BUILD.bazel index 92664dd7e..b3eb87af8 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,3 +1,4 @@ +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") load("@io_bazel_rules_go//go:def.bzl", "nogo") load("//:def.bzl", "gazelle", "gazelle_binary") @@ -71,3 +72,15 @@ filegroup( ], visibility = ["//visibility:public"], ) + +bzl_library( + name = "bzl_srcs", + srcs = [ + "def.bzl", + "deps.bzl", + ], + deps = [ + "//internal:bzl_srcs", + ], + visibility = ["//visibility:public"], +) diff --git a/WORKSPACE b/WORKSPACE index 2f70b29c5..1bb75d6f2 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -23,6 +23,22 @@ load("//:deps.bzl", "gazelle_dependencies") gazelle_dependencies() +load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") + +maybe( + http_archive, + name = "bazel_skylib", + sha256 = "1c531376ac7e5a180e0237938a2536de0c54d93f5c278634818e0efc952dd56c", + urls = [ + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz", + ], +) + +load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") + +bazel_skylib_workspace() + # gazelle:repository go_repository name=org_golang_x_sync importpath=golang.org/x/sync # gazelle:repository go_repository name=org_golang_x_sys importpath=golang.org/x/sys # gazelle:repository go_repository name=org_golang_x_xerrors importpath=golang.org/x/xerrors diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel index c92e1be7b..1d4547931 100644 --- a/internal/BUILD.bazel +++ b/internal/BUILD.bazel @@ -1,3 +1,4 @@ +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") load("@io_bazel_rules_go//go/tools/bazel_testing:def.bzl", "go_bazel_test") # gazelle:exclude *_test.go @@ -47,3 +48,17 @@ filegroup( ], visibility = ["//visibility:public"], ) + +bzl_library( + name = "bzl_srcs", + srcs = [ + "gazelle_binary.bzl", + "go_repository.bzl", + "go_repository_cache.bzl", + "go_repository_config.bzl", + "go_repository_tools.bzl", + "go_repository_tools_srcs.bzl", + "overlay_repository.bzl", + ], + visibility = ["//:__pkg__"], +)