More p4runtime-related bazel build files
Change-Id: Icdd02a06d7905e4cd0a6c61d282fd522c7b75fe7
diff --git a/protocols/gnmi/BUILD b/protocols/gnmi/BUILD
new file mode 100644
index 0000000..56ed52c
--- /dev/null
+++ b/protocols/gnmi/BUILD
@@ -0,0 +1,16 @@
+BUNDLES = [
+ "//protocols/gnmi/stub:gnmi_java_grpc",
+ "//protocols/gnmi/stub:gnmi_java_proto",
+]
+
+onos_app(
+ app_name = "org.onosproject.protocols.gnmi",
+ title = "gNMI Protocol Subsystem",
+ category = "Protocol",
+ url = "http://onosproject.org",
+ description = "ONOS gNMI protocol subsystem",
+ included_bundles = BUNDLES,
+ required_apps = [
+ "org.onosproject.protocols.grpc"
+ ],
+)
diff --git a/protocols/gnmi/stub/BUILD b/protocols/gnmi/stub/BUILD
new file mode 100644
index 0000000..3dc5351
--- /dev/null
+++ b/protocols/gnmi/stub/BUILD
@@ -0,0 +1,43 @@
+load("//tools/build/bazel:osgi_java_library.bzl", "wrapped_osgi_jar")
+load("@io_grpc_grpc_java//:java_grpc_library.bzl", "java_grpc_library")
+
+wrapped_osgi_jar(
+ name = "gnmi_java_grpc",
+ jar = ":gnmi_java_grpc_native",
+ deps = [
+ "@io_grpc_grpc_java//stub",
+ "@io_grpc_grpc_java//core",
+ "@io_grpc_grpc_java//protobuf"
+ ],
+ visibility = ["//visibility:public"],
+)
+
+wrapped_osgi_jar(
+ name = "gnmi_java_proto",
+ jar = ":gnmi_java_proto_native",
+ deps = [
+ "@com_google_protobuf//:protobuf_java",
+ ],
+ visibility = ["//visibility:public"],
+)
+
+java_proto_library(
+ name = "gnmi_java_proto_native",
+ deps = [":gnmi_proto"],
+ visibility = ["//visibility:public"],
+)
+
+java_grpc_library(
+ name = "gnmi_java_grpc_native",
+ srcs = [":gnmi_proto"],
+ deps = [":gnmi_java_proto_native"],
+)
+
+proto_library(
+ name = "gnmi_proto",
+ srcs = ["src/main/proto/gnmi.proto"],
+ deps = [
+ "@com_google_protobuf//:any_proto",
+ "@com_google_protobuf//:descriptor_proto",
+ ]
+)
diff --git a/protocols/p4runtime/BUILD b/protocols/p4runtime/BUILD
index 66e2f59..407aa46 100644
--- a/protocols/p4runtime/BUILD
+++ b/protocols/p4runtime/BUILD
@@ -1,18 +1,24 @@
BUNDLES = [
- '//protocols/p4runtime/api:onos-protocols-p4runtime-api',
- '//protocols/p4runtime/ctl:onos-protocols-p4runtime-ctl',
- '//protocols/p4runtime/model:onos-protocols-p4runtime-model',
+ "//protocols/p4runtime/api:onos-protocols-p4runtime-api",
+ "//protocols/p4runtime/ctl:onos-protocols-p4runtime-ctl",
+ "//protocols/p4runtime/model:onos-protocols-p4runtime-model",
"//protocols/p4runtime/proto:p4runtime_java_grpc",
+ "//protocols/p4runtime/proto:p4config_java_proto",
+ "//protocols/p4runtime/proto:p4data_java_proto",
+ "//protocols/p4runtime/proto:p4info_java_proto",
+ "//protocols/p4runtime/proto:p4runtime_java_proto",
+ "//protocols/p4runtime/proto:p4types_java_proto",
+ "//protocols/p4runtime/proto:status_java_proto",
]
onos_app(
- app_name = 'org.onosproject.protocols.p4runtime',
- title = 'P4Runtime Protocol Subsystem',
- category = 'Protocol',
- url = 'http://onosproject.org',
- description = 'ONOS P4Runtime protocol subsystem',
+ app_name = "org.onosproject.protocols.p4runtime",
+ title = "P4Runtime Protocol Subsystem",
+ category = "Protocol",
+ url = "http://onosproject.org",
+ description = "ONOS P4Runtime protocol subsystem",
included_bundles = BUNDLES,
required_apps = [
- 'org.onosproject.protocols.grpc'
+ "org.onosproject.protocols.grpc"
],
)
diff --git a/protocols/p4runtime/proto/BUILD b/protocols/p4runtime/proto/BUILD
index 2da5615..4c99b0d 100644
--- a/protocols/p4runtime/proto/BUILD
+++ b/protocols/p4runtime/proto/BUILD
@@ -1,58 +1,61 @@
load("//tools/build/bazel:osgi_java_library.bzl", "wrapped_osgi_jar")
load("@io_grpc_grpc_java//:java_grpc_library.bzl", "java_grpc_library")
+GRPC_DEPS = [
+ "@io_grpc_grpc_java//stub",
+ "@io_grpc_grpc_java//core",
+ "@io_grpc_grpc_java//protobuf",
+]
+
+PROTOBUF_DEPS = [
+ "@com_google_protobuf//:protobuf_java",
+]
+
wrapped_osgi_jar(
name = "p4config_java_proto",
jar = "@com_github_p4lang_pi//:p4config_java_proto_native",
- deps = [
- "@com_google_protobuf//:protobuf_java",
- ],
+ deps = PROTOBUF_DEPS,
visibility = ["//visibility:public"],
)
wrapped_osgi_jar(
name = "p4data_java_proto",
jar = "@com_github_p4lang_p4runtime//:p4data_java_proto_native",
- deps = [
- "@com_google_protobuf//:protobuf_java",
- ],
+ deps = PROTOBUF_DEPS,
+ visibility = ["//visibility:public"],
+)
+
+wrapped_osgi_jar(
+ name = "p4types_java_proto",
+ jar = "@com_github_p4lang_p4runtime//:p4types_java_proto_native",
+ deps = PROTOBUF_DEPS,
visibility = ["//visibility:public"],
)
wrapped_osgi_jar(
name = "p4info_java_proto",
jar = "@com_github_p4lang_p4runtime//:p4info_java_proto_native",
- deps = [
- "@com_google_protobuf//:protobuf_java",
- ],
+ deps = PROTOBUF_DEPS,
visibility = ["//visibility:public"],
)
wrapped_osgi_jar(
name = "p4runtime_java_proto",
jar = "@com_github_p4lang_p4runtime//:p4runtime_java_proto_native",
- deps = [
- "@com_google_protobuf//:protobuf_java",
- ],
+ deps = PROTOBUF_DEPS,
visibility = ["//visibility:public"],
)
wrapped_osgi_jar(
name = "p4runtime_java_grpc",
jar = "@com_github_p4lang_p4runtime//:p4runtime_java_grpc_native",
- deps = [
- "@io_grpc_grpc_java//stub",
- "@io_grpc_grpc_java//core",
- "@io_grpc_grpc_java//protobuf",
- ],
+ deps = GRPC_DEPS,
visibility = ["//visibility:public"],
)
wrapped_osgi_jar(
name = "status_java_proto",
jar = "@com_github_googleapis//:status_java_proto_native",
- deps = [
- "@com_google_protobuf//:protobuf_java",
- ],
+ deps = PROTOBUF_DEPS,
visibility = ["//visibility:public"],
)