Skip to content

Commit

Permalink
Fix gazelle rule and run bazel run //:gazelle
Browse files Browse the repository at this point in the history
  • Loading branch information
gmacf committed Jul 19, 2023
1 parent 38ebfe0 commit 6becdc3
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 16 deletions.
3 changes: 1 addition & 2 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
load("@bazel_gazelle//:def.bzl", "gazelle")

# gazelle:prefix github.com/openconfig/gnsi
# gazelle:prefix github.com/openconfig/bootz
gazelle(name = "gazelle")

9 changes: 9 additions & 0 deletions client/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "client",
srcs = ["client.go"],
importpath = "github.com/openconfig/bootz/client",
visibility = ["//visibility:public"],
deps = ["@org_golang_google_grpc//:go_default_library"],
)
24 changes: 10 additions & 14 deletions proto/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ use_new_compilers()
proto_library(
name = "bootz_proto",
srcs = ["bootz.proto"],
import_prefix = "github.com/openconfig/bootz",
deps = [
"//github.com/openconfig/gnsi/authz:authz_proto",
"//github.com/openconfig/gnsi/certz:certz_proto",
"//github.com/openconfig/gnsi/credentialz:credentialz_proto",
"//github.com/openconfig/gnsi/pathz:pathz_proto",
"@com_google_protobuf//:struct_proto",
"@com_github_openconfig_gnsi//authz:authz_proto",
"@com_github_openconfig_gnsi//certz:certz_proto",
"@com_github_openconfig_gnsi//credentialz:credentialz_proto",
"@com_github_openconfig_gnsi//pathz:pathz_proto",
],
)

Expand All @@ -26,22 +25,19 @@ proto_library(

go_proto_library(
name = "bootz_go_proto",
compilers = [
"go_protoc_gen_go",
"go_protoc_gen_go_grpc",
],
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
importpath = "github.com/openconfig/bootz/proto/bootz",
proto = ":bootz_proto",
deps = [
"@com_github_openconfig_gnsi//authz:authz_go_proto",
"@com_github_openconfig_gnsi//certz:certz_go_proto",
"@com_github_openconfig_gnsi//credentialz:credentialz_go_proto",
"@com_github_openconfig_gnsi//pathz:pathz_go_proto",
"//github.com/openconfig/gnsi/authz:authz_proto",
"//github.com/openconfig/gnsi/certz:certz_proto",
"//github.com/openconfig/gnsi/credentialz:credentialz_proto",
"//github.com/openconfig/gnsi/pathz:pathz_proto",
],
)

go_library(
name = "bootz",
embed = [":bootz_go_proto"],
importpath = "github.com/openconfig/bootz/proto/bootz",
)
)
23 changes: 23 additions & 0 deletions proto/bootz/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "bootz",
srcs = [
"bootz.pb.go",
"bootz_grpc.pb.go",
],
importpath = "github.com/openconfig/bootz/proto/bootz",
visibility = ["//visibility:public"],
deps = [
"@com_github_openconfig_gnsi//authz",
"@com_github_openconfig_gnsi//certz",
"@com_github_openconfig_gnsi//credentialz",
"@com_github_openconfig_gnsi//pathz",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//codes:go_default_library",
"@org_golang_google_grpc//status:go_default_library",
"@org_golang_google_protobuf//reflect/protoreflect:go_default_library",
"@org_golang_google_protobuf//runtime/protoimpl:go_default_library",
"@org_golang_google_protobuf//types/known/structpb:go_default_library",
],
)
19 changes: 19 additions & 0 deletions server/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")

go_library(
name = "server_lib",
srcs = ["server.go"],
importpath = "github.com/openconfig/bootz/server",
visibility = ["//visibility:private"],
deps = [
"//server/service",
"@com_github_labstack_gommon//log:go_default_library",
"@org_golang_google_grpc//:go_default_library",
],
)

go_binary(
name = "server",
embed = [":server_lib"],
visibility = ["//visibility:public"],
)
13 changes: 13 additions & 0 deletions server/service/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "service",
srcs = ["service.go"],
importpath = "github.com/openconfig/bootz/server/service",
visibility = ["//visibility:public"],
deps = [
"@com_github_openconfig_gnmi//errlist",
"@org_golang_google_grpc//codes:go_default_library",
"@org_golang_google_grpc//status:go_default_library",
],
)

0 comments on commit 6becdc3

Please sign in to comment.