Skip to content

Commit

Permalink
Fix build imports
Browse files Browse the repository at this point in the history
  • Loading branch information
marcushines committed Feb 27, 2024
1 parent 9708792 commit 77dd645
Show file tree
Hide file tree
Showing 32 changed files with 2,801 additions and 1,654 deletions.
75 changes: 24 additions & 51 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
workspace(name = "com_github_openconfig_gnoi")

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

### Bazel rules for many languages to compile PROTO into gRPC libraries
Expand All @@ -8,6 +10,20 @@ http_archive(
urls = ["https://github.com/rules-proto-grpc/rules_proto_grpc/archive/4.6.0.tar.gz"],
)

http_archive(
name = "com_google_googleapis",
sha256 = "9fc03150d86501d7da35eefa989d5553bdd77a95cfe4373cdafe8eee92f6bfb1",
strip_prefix = "googleapis-870a5ed7e141b4faf70e2a0858854e9b5bb18612",
urls = ["https://github.com/googleapis/googleapis/archive/870a5ed7e141b4faf70e2a0858854e9b5bb18612.tar.gz"],
)

load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language")
switched_rules_by_language(
name = "com_google_googleapis_imports",
cc = True,
go = True,
)

load(
"@rules_proto_grpc//:repositories.bzl",
"bazel_gazelle",
Expand Down Expand Up @@ -38,64 +54,20 @@ go_register_toolchains(go_version = "1.20")
# gazelle:repo bazel_gazelle
bazel_gazelle()

load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")

go_repository(
name = "com_github_openconfig_bootz",
importpath = "github.com/openconfig/bootz",
sum = "h1:pCBi4GXcT+XM2Vud8kh0Q6uyw6oUxN1CFvrxnW+I/as=",
version = "v0.1.1",
)


go_repository(
name = "com_github_openconfig_gnmi",
build_directives = [
"gazelle:proto_import_prefix github.com/openconfig/gnmi",
],
build_file_generation = "on",
importpath = "github.com/openconfig/gnmi",
sum = "h1:tv9HygDMXnoGyWuLmNCodMV2+PK6+uT/ndAxDVzsUUQ=",
version = "v0.0.0-20220617175856-41246b1b3507",
)
load("//:gnoi_deps.bzl", "gnoi_deps")

go_repository(
name = "com_github_openconfig_gnsi",
importpath = "github.com/openconfig/gnsi",
sum = "h1:oHdSFP1CpP+mfv6IOKWefHpbW3Fy9ZOSHgPgpCb8EDU=",
version = "v1.2.4",
)

go_repository(
name = "com_github_kylelemons_godebug",
importpath = "github.com/kylelemons/godebug",
sum = "h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=",
version = "v1.1.0",
)

go_repository(
name = "com_github_openconfig_goyang",
importpath = "github.com/openconfig/goyang",
sum = "h1:Z95LskKYk6nBYOxHtmJCu3YEKlr3pJLWG1tYAaNh3yU=",
version = "v0.2.9",
)

go_repository(
name = "com_github_openconfig_ygot",
build_directives = [
"gazelle:proto_import_prefix github.com/openconfig/ygot",
],
importpath = "github.com/openconfig/ygot",
sum = "h1:EKaeFhx1WwTZGsYeqipyh1mfF8y+z2StaXZtwVnXklk=",
version = "v0.13.1",
)

gazelle_dependencies()
gnoi_deps()

load("@rules_proto_grpc//go:repositories.bzl", rules_proto_grpc_go_repos = "go_repos")

rules_proto_grpc_go_repos()

# Load gazelle_dependencies last, so that the newer version of org_golang_google_grpc is used.
# see https://github.com/rules-proto-grpc/rules_proto_grpc/issues/160
gazelle_dependencies()

### C++
load("@rules_proto_grpc//cpp:repositories.bzl", rules_proto_grpc_cpp_repos = "cpp_repos")

Expand All @@ -105,6 +77,7 @@ load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")

grpc_deps()


# open-config YANG files
http_archive(
name = "github_openconfig_yang",
Expand Down
169 changes: 118 additions & 51 deletions bgp/bgp.pb.go

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

2 changes: 1 addition & 1 deletion bgp/bgp.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ syntax = "proto3";

package gnoi.bgp;

import "types/types.proto";
import "github.com/openconfig/gnoi/types/types.proto";

option go_package = "github.com/openconfig/gnoi/bgp";

Expand Down
7 changes: 3 additions & 4 deletions bootconfig/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
load("@rules_proto_grpc//go:defs.bzl", "go_grpc_library")
load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library")

#Copyright 2021 Google LLC
Expand Down Expand Up @@ -43,11 +43,10 @@ cc_grpc_library(
deps = [":bootconfig_cc_proto"],
)

go_proto_library(
go_grpc_library(
name = "bootconfig_go_proto",
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
importpath = "github.com/openconfig/gnoi/bootconfig",
proto = ":bootconfig_proto",
protos = [":bootconfig_proto"],
deps = [
"//types",
"@com_github_openconfig_bootz//proto:bootz_go_proto",
Expand Down
Loading

0 comments on commit 77dd645

Please sign in to comment.