blob: 3d46f95d1acf20b421a5ae64240eda7dfd8f56d5 [file] [log] [blame]
Carmelo Cascone6a1ae712018-08-10 12:19:47 -07001load("//tools/build/bazel:osgi_java_library.bzl", "wrapped_osgi_jar")
Carmelo Cascone72893b72018-08-09 00:59:06 -07002
3BUNDLES = [
Carmelo Cascone6a1ae712018-08-10 12:19:47 -07004 "//protocols/grpc/proto:onos-protocols-grpc-proto",
Carmelo Cascone72893b72018-08-09 00:59:06 -07005 "//protocols/grpc/api:onos-protocols-grpc-api",
6 "//protocols/grpc/ctl:onos-protocols-grpc-ctl",
Carmelo Cascone6a1ae712018-08-10 12:19:47 -07007 # gRPC dependencies (with patched core)
Carmelo Cascone0f8b7be2019-01-29 16:10:57 -08008 ":grpc-bundle-core",
9 ":grpc-bundle-stub",
10 ":grpc-bundle-netty",
11 ":grpc-bundle-auth",
12 ":grpc-bundle-protobuf",
13 ":grpc-bundle-protobuf-lite",
14 ":protobuf-java-bundle",
Carmelo Cascone6a1ae712018-08-10 12:19:47 -070015 "@com_google_api_grpc_proto_google_common_protos//jar",
16 "@com_google_errorprone_error_prone_annotations//jar",
17 "@com_google_auth_google_auth_library_credentials//jar",
18 "@io_opencensus_opencensus_api//jar",
19 "@io_opencensus_opencensus_contrib_grpc_metrics//jar",
20 "@com_google_code_gson_gson//jar",
Carmelo Cascone72893b72018-08-09 00:59:06 -070021]
22
Ray Milkey05d609a2018-08-15 10:27:58 -070023onos_app(
Carmelo Cascone72893b72018-08-09 00:59:06 -070024 app_name = "org.onosproject.protocols.grpc",
Thomas Vachuskad8e77952018-11-19 12:26:43 -080025 category = "Protocol",
Carmelo Cascone72893b72018-08-09 00:59:06 -070026 description = "Exposes APIs to operate with gRPC channels",
27 included_bundles = BUNDLES,
Ray Milkey05d609a2018-08-15 10:27:58 -070028 title = "gRPC Protocol Subsystem",
29 url = "ttp://onosproject.org",
Carmelo Cascone72893b72018-08-09 00:59:06 -070030)
Carmelo Cascone6a1ae712018-08-10 12:19:47 -070031
Carmelo Cascone0f8b7be2019-01-29 16:10:57 -080032# Wrap protobuf and grpc-related JARs in OSGi-compatible ones, since the
33# original one are built with Bazel and NOT imported via mvn.
34
35# FIXME: consider moving these rules somewhere else as other apps depend on it
36# (e.g. openstacktelemetry and kafka-integration) but they don't directly
37# depend on any onos-protocols-grpc-* module.
38
Carmelo Cascone6a1ae712018-08-10 12:19:47 -070039wrapped_osgi_jar(
Carmelo Cascone0f8b7be2019-01-29 16:10:57 -080040 # Differently from the official "grpc-core" package, here we also include
41 # "grpc-context" to solve the OSGI split-brain problem:
42 # https://github.com/grpc/grpc-java/issues/2727
43 # We use patched Bazel BUILD files to package together core and context (see
44 # tools/build/bazel/grpc_workspace.bzl). If you need grpc-context as a
45 # compile-time dependency, please use this one.
46 name = "grpc-bundle-core",
Ray Milkey05d609a2018-08-15 10:27:58 -070047 jar = "@io_grpc_grpc_java//core",
Carmelo Cascone6a1ae712018-08-10 12:19:47 -070048 visibility = ["//visibility:public"],
Carmelo Cascone0f8b7be2019-01-29 16:10:57 -080049 deps = [],
50)
51
52wrapped_osgi_jar(
53 name = "grpc-bundle-stub",
54 jar = "@io_grpc_grpc_java//stub",
55 visibility = ["//visibility:public"],
56 deps = [],
57)
58
59wrapped_osgi_jar(
60 name = "grpc-bundle-netty",
61 jar = "@io_grpc_grpc_java//netty",
62 visibility = ["//visibility:public"],
63 deps = [],
64)
65
66wrapped_osgi_jar(
67 name = "grpc-bundle-auth",
68 jar = "@io_grpc_grpc_java//auth",
69 visibility = ["//visibility:public"],
70 deps = [],
71)
72
73wrapped_osgi_jar(
74 name = "grpc-bundle-protobuf",
75 jar = "@io_grpc_grpc_java//protobuf",
76 visibility = ["//visibility:public"],
77 deps = [],
78)
79
80wrapped_osgi_jar(
81 name = "grpc-bundle-protobuf-lite",
82 jar = "@io_grpc_grpc_java//protobuf-lite",
83 visibility = ["//visibility:public"],
84 deps = [],
85)
86
87wrapped_osgi_jar(
88 name = "protobuf-java-bundle",
89 jar = "@com_google_protobuf//:protobuf_java",
90 visibility = ["//visibility:public"],
91 deps = [],
Carmelo Cascone6a1ae712018-08-10 12:19:47 -070092)