bazel: add initial Gazelle integration

Gazelle is a build file generator for Go modules.
This commit is contained in:
Richard Patel 2022-10-29 15:57:55 +02:00
parent c6bbf95022
commit c78ee582ce
2 changed files with 37 additions and 0 deletions

22
BUILD Normal file
View File

@ -0,0 +1,22 @@
load("@bazel_gazelle//:def.bzl", "gazelle")
# gazelle:prefix go.firedancer.io/radiance
# gazelle:build_file_name BUILD
gazelle(name = "gazelle")
gazelle(
name = "gazelle-update-repos",
args = [
"-from_file=go.mod",
"-to_macro=third_party/go/repositories.bzl%go_repositories",
"-prune",
],
command = "update-repos",
)
# Shortcut for the Go SDK
alias(
name = "go",
actual = "@go_sdk//:bin/go",
visibility = ["//visibility:public"],
)

View File

@ -32,8 +32,23 @@ go_rules_dependencies()
go_register_toolchains(version = "1.19.2")
################################################################################
# Custom Go dependencies #
################################################################################
# add `go_repository` rules here to override Gazelle-generated files.
################################################################################
# go mod #
################################################################################
gazelle_dependencies()
load("//:third_party/go/repositories.bzl", "go_repositories")
# gazelle:repository_macro third_party/go/repositories.bzl%go_repositories
go_repositories()
# Protobuf
http_archive(