Start bazel support for protobuf models and p4runtime build
Change-Id: Ib3beb70c1b401854444b106b4af3723cd40635e4
diff --git a/protocols/p4runtime/api/BUILD b/protocols/p4runtime/api/BUILD
index 50a0624..4b86e7f 100644
--- a/protocols/p4runtime/api/BUILD
+++ b/protocols/p4runtime/api/BUILD
@@ -1,14 +1,14 @@
-GRPC_VER = "1.3.1"
+GRPC_VER = "1_3_1"
COMPILE_DEPS = CORE_DEPS + [
- # '@grpc//jar',
+ "@grpc_core_" + GRPC_VER + "//jar",
]
TEST_DEPS = TEST + [
"//core/api:onos-api-tests",
]
-#osgi_jar_with_tests (
-# deps = COMPILE_DEPS,
-# test_deps = TEST_DEPS,
-#)
+osgi_jar_with_tests (
+ deps = COMPILE_DEPS,
+ test_deps = TEST_DEPS,
+)
diff --git a/protocols/p4runtime/model/BUILD b/protocols/p4runtime/model/BUILD
index 39c314e..5fa75cd 100644
--- a/protocols/p4runtime/model/BUILD
+++ b/protocols/p4runtime/model/BUILD
@@ -1,10 +1,11 @@
PROTOBUF_VER = "3_2_0"
COMPILE_DEPS = CORE_DEPS + [
- #'//protocols/p4runtime/proto:onos-protocols-p4runtime-proto',
- #'@grpc_protobuf_' + PROTOBUF_VER + "//jar",
+ "//protocols/p4runtime/proto:p4_runtime_java_proto",
+ "//protocols/p4runtime/proto:p4_config_java_proto",
+ "@com_google_protobuf//:protobuf_java",
]
-#osgi_jar_with_tests (
-# deps = COMPILE_DEPS,
-#)
+osgi_jar_with_tests (
+ deps = COMPILE_DEPS,
+)
diff --git a/protocols/p4runtime/proto/BUILD b/protocols/p4runtime/proto/BUILD
new file mode 100644
index 0000000..2a6d5f5
--- /dev/null
+++ b/protocols/p4runtime/proto/BUILD
@@ -0,0 +1,24 @@
+java_proto_library(
+ name = "p4_types_java_proto",
+ deps = [ "@p4lang_pi//:p4types_proto" ],
+ visibility = ["//visibility:public"],
+)
+
+java_proto_library(
+ name = "p4_config_java_proto",
+ deps = [ "@p4lang_pi//:p4config_proto" ],
+ visibility = ["//visibility:public"],
+)
+
+java_proto_library(
+ name = "p4_tmp_config_java_proto",
+ deps = [ "@p4lang_pi//:p4_tmp_config_proto" ],
+ visibility = ["//visibility:public"],
+)
+
+java_proto_library(
+ name = "p4_runtime_java_proto",
+ deps = [ "@p4lang_pi//:p4_runtime_proto" ],
+ visibility = ["//visibility:public"],
+)
+