Fix p4runtime runtime dependencies when building with Bazel
A convenient macro for packaging together all proto and gRPC libraries
in an OSGi jar is provided. Also re-packaging of gRPC core (to avoid OSGi
split problem) is simplified by depending on a patched fork of grpc-java.
Change-Id: Idb79a5bea8ae0bc57b146bda1fc47a4568d12c60
diff --git a/tools/build/bazel/p4runtime_BUILD b/tools/build/bazel/p4runtime_BUILD
index 8d1b221..db7598e 100644
--- a/tools/build/bazel/p4runtime_BUILD
+++ b/tools/build/bazel/p4runtime_BUILD
@@ -1,27 +1,3 @@
-package(default_visibility = ["//visibility:public"])
-
-load("@com_google_protobuf//:protobuf.bzl", "internal_copied_filegroup")
-load("@io_grpc_grpc_java//:java_grpc_library.bzl", "java_grpc_library")
-
-proto_library(
- name = "p4data_proto",
- srcs = ["p4/v1/p4data.proto"],
-)
-
-proto_library(
- name = "p4types_proto",
- srcs = ["p4/config/v1/p4types.proto"],
-)
-
-proto_library(
- name = "p4info_proto",
- srcs = ["p4/config/v1/p4info.proto"],
- deps = [
- ":p4types_proto",
- "@com_google_protobuf//:any_proto"
- ],
-)
-
proto_library(
name = "p4runtime_proto",
srcs = ["p4/v1/p4runtime.proto"],
@@ -31,31 +7,27 @@
"@com_github_googleapis//:status_proto",
"@com_google_protobuf//:any_proto",
],
+ visibility = ["//visibility:public"],
)
-java_proto_library(
- name = "p4data_java_proto_native",
- deps = [":p4data_proto"],
+proto_library(
+ name = "p4data_proto",
+ srcs = ["p4/v1/p4data.proto"],
+ visibility = ["//visibility:public"],
)
-java_proto_library(
- name = "p4types_java_proto_native",
- deps = [":p4types_proto"],
+proto_library(
+ name = "p4types_proto",
+ srcs = ["p4/config/v1/p4types.proto"],
+ visibility = ["//visibility:public"],
)
-java_proto_library(
- name = "p4info_java_proto_native",
- deps = [":p4info_proto"],
+proto_library(
+ name = "p4info_proto",
+ srcs = ["p4/config/v1/p4info.proto"],
+ deps = [
+ ":p4types_proto",
+ "@com_google_protobuf//:any_proto"
+ ],
+ visibility = ["//visibility:public"],
)
-
-java_proto_library(
- name = "p4runtime_java_proto_native",
- deps = [":p4runtime_proto"],
-)
-
-java_grpc_library(
- name = "p4runtime_java_grpc_native",
- srcs = [":p4runtime_proto"],
- deps = [":p4runtime_java_proto_native"],
-)
-