Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ platforms:
- "-@go_googleapis//google/rpc:status_proto"
- "-@go_googleapis//google/type:color_go_proto"
- "-@gogo_special_proto//github.com/gogo/protobuf/gogoproto:gogoproto"
- "-//go/tools/bazel:go_default_test"
- "-//go/tools/bazel:bazel_test"
- "-@io_bazel_rules_go//proto:gogofaster_proto"
- "-@io_bazel_rules_go//proto:go_grpc"
- "-@io_bazel_rules_go//proto:go_proto"
Expand Down Expand Up @@ -254,7 +254,7 @@ platforms:
test_targets:
- "--"
- "..."
- "-//go/tools/bazel:go_default_test"
- "-//go/tools/bazel:bazel_test"
- "-@org_golang_x_crypto//ed25519:go_default_test"
- "-@org_golang_x_crypto//sha3:go_default_test"
- "-@org_golang_x_net//ipv4:go_default_test"
Expand Down
14 changes: 14 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@ load(
"stdlib",
)

# gazelle:prefix github.com/bazelbuild/rules_go
# gazelle:exclude tests
# gazelle:exclude third_party
# gazelle:exclude go/tools/builders
# gazelle:exclude go/tools/coverdata
# gazelle:exclude go/tools/fetch_repo
# gazelle:exclude go/tools/windows-testrunner
# gazelle:exclude go/tools/testwrapper
# gazelle:go_naming_convention import_alias

# TODO(jayconrod): add a gazelle rule so gazelle can be run automatically.
# It can't go here though, because it would break anything that depends on
# rules_go but not Gazelle, including our own go_bazel_tests.

stdlib(
name = "stdlib",
cgo_context_data = select({
Expand Down
12 changes: 9 additions & 3 deletions go/tools/bazel/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "go_default_library",
name = "bazel",
srcs = [
"bazel.go",
"runfiles.go",
Expand All @@ -11,11 +11,11 @@ go_library(
)

go_test(
name = "go_default_test",
name = "bazel_test",
size = "small",
srcs = ["bazel_test.go"],
data = ["empty.txt"],
embed = [":go_default_library"],
embed = [":bazel"],
)

# Runfiles functionality in this package is tested by //tests/core/runfiles.
Expand All @@ -26,3 +26,9 @@ filegroup(
srcs = glob(["**"]),
visibility = ["//visibility:public"],
)

alias(
name = "go_default_library",
actual = ":bazel",
visibility = ["//visibility:public"],
)
10 changes: 9 additions & 1 deletion go/tools/bazel_benchmark/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary")
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")

go_binary(
name = "bazel_benchmark",
embed = [":bazel_benchmark_lib"],
visibility = ["//visibility:public"],
)

go_library(
name = "bazel_benchmark_lib",
srcs = ["bazel_benchmark.go"],
importpath = "github.com/bazelbuild/rules_go/go/tools/bazel_benchmark",
visibility = ["//visibility:private"],
)
12 changes: 9 additions & 3 deletions go/tools/bazel_testing/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "go_default_library",
name = "bazel_testing",
srcs = ["bazel_testing.go"],
importpath = "github.com/bazelbuild/rules_go/go/tools/bazel_testing",
visibility = ["//visibility:public"],
deps = [
"//go/tools/bazel:go_default_library",
"//go/tools/internal/txtar:go_default_library",
"//go/tools/bazel",
"//go/tools/internal/txtar",
],
)

Expand All @@ -17,3 +17,9 @@ filegroup(
srcs = glob(["**"]),
visibility = ["//visibility:public"],
)

alias(
name = "go_default_library",
actual = ":bazel_testing",
visibility = ["//visibility:public"],
)
12 changes: 9 additions & 3 deletions go/tools/internal/txtar/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "go_default_library",
name = "txtar",
srcs = ["archive.go"],
importpath = "github.com/bazelbuild/rules_go/go/tools/internal/txtar",
visibility = ["//go/tools:__subpackages__"],
)

go_test(
name = "go_default_test",
name = "txtar_test",
srcs = ["archive_test.go"],
embed = [":go_default_library"],
embed = [":txtar"],
)

alias(
name = "go_default_library",
actual = ":txtar",
visibility = ["//go/tools:__subpackages__"],
)