Carmelo Cascone | 6a1ae71 | 2018-08-10 12:19:47 -0700 | [diff] [blame] | 1 | load("//tools/build/bazel:osgi_java_library.bzl", "wrapped_osgi_jar") |
Carmelo Cascone | 72893b7 | 2018-08-09 00:59:06 -0700 | [diff] [blame] | 2 | |
| 3 | BUNDLES = [ |
Carmelo Cascone | 6a1ae71 | 2018-08-10 12:19:47 -0700 | [diff] [blame] | 4 | "//protocols/grpc/proto:onos-protocols-grpc-proto", |
Carmelo Cascone | 72893b7 | 2018-08-09 00:59:06 -0700 | [diff] [blame] | 5 | "//protocols/grpc/api:onos-protocols-grpc-api", |
| 6 | "//protocols/grpc/ctl:onos-protocols-grpc-ctl", |
Carmelo Cascone | 6a1ae71 | 2018-08-10 12:19:47 -0700 | [diff] [blame] | 7 | # gRPC dependencies (with patched core) |
Carmelo Cascone | 0f8b7be | 2019-01-29 16:10:57 -0800 | [diff] [blame] | 8 | ":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 Cascone | 6a1ae71 | 2018-08-10 12:19:47 -0700 | [diff] [blame] | 15 | "@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 Cascone | 72893b7 | 2018-08-09 00:59:06 -0700 | [diff] [blame] | 21 | ] |
| 22 | |
Ray Milkey | 05d609a | 2018-08-15 10:27:58 -0700 | [diff] [blame] | 23 | onos_app( |
Carmelo Cascone | 72893b7 | 2018-08-09 00:59:06 -0700 | [diff] [blame] | 24 | app_name = "org.onosproject.protocols.grpc", |
Thomas Vachuska | d8e7795 | 2018-11-19 12:26:43 -0800 | [diff] [blame] | 25 | category = "Protocol", |
Carmelo Cascone | 72893b7 | 2018-08-09 00:59:06 -0700 | [diff] [blame] | 26 | description = "Exposes APIs to operate with gRPC channels", |
| 27 | included_bundles = BUNDLES, |
Ray Milkey | 05d609a | 2018-08-15 10:27:58 -0700 | [diff] [blame] | 28 | title = "gRPC Protocol Subsystem", |
| 29 | url = "ttp://onosproject.org", |
Carmelo Cascone | 72893b7 | 2018-08-09 00:59:06 -0700 | [diff] [blame] | 30 | ) |
Carmelo Cascone | 6a1ae71 | 2018-08-10 12:19:47 -0700 | [diff] [blame] | 31 | |
Carmelo Cascone | 0f8b7be | 2019-01-29 16:10:57 -0800 | [diff] [blame] | 32 | # 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 Cascone | 6a1ae71 | 2018-08-10 12:19:47 -0700 | [diff] [blame] | 39 | wrapped_osgi_jar( |
Carmelo Cascone | 0f8b7be | 2019-01-29 16:10:57 -0800 | [diff] [blame] | 40 | # 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 Milkey | 05d609a | 2018-08-15 10:27:58 -0700 | [diff] [blame] | 47 | jar = "@io_grpc_grpc_java//core", |
Carmelo Cascone | 6a1ae71 | 2018-08-10 12:19:47 -0700 | [diff] [blame] | 48 | visibility = ["//visibility:public"], |
Carmelo Cascone | 0f8b7be | 2019-01-29 16:10:57 -0800 | [diff] [blame] | 49 | deps = [], |
| 50 | ) |
| 51 | |
| 52 | wrapped_osgi_jar( |
| 53 | name = "grpc-bundle-stub", |
| 54 | jar = "@io_grpc_grpc_java//stub", |
| 55 | visibility = ["//visibility:public"], |
| 56 | deps = [], |
| 57 | ) |
| 58 | |
| 59 | wrapped_osgi_jar( |
| 60 | name = "grpc-bundle-netty", |
| 61 | jar = "@io_grpc_grpc_java//netty", |
| 62 | visibility = ["//visibility:public"], |
| 63 | deps = [], |
| 64 | ) |
| 65 | |
| 66 | wrapped_osgi_jar( |
| 67 | name = "grpc-bundle-auth", |
| 68 | jar = "@io_grpc_grpc_java//auth", |
| 69 | visibility = ["//visibility:public"], |
| 70 | deps = [], |
| 71 | ) |
| 72 | |
| 73 | wrapped_osgi_jar( |
| 74 | name = "grpc-bundle-protobuf", |
| 75 | jar = "@io_grpc_grpc_java//protobuf", |
| 76 | visibility = ["//visibility:public"], |
| 77 | deps = [], |
| 78 | ) |
| 79 | |
| 80 | wrapped_osgi_jar( |
| 81 | name = "grpc-bundle-protobuf-lite", |
| 82 | jar = "@io_grpc_grpc_java//protobuf-lite", |
| 83 | visibility = ["//visibility:public"], |
| 84 | deps = [], |
| 85 | ) |
| 86 | |
| 87 | wrapped_osgi_jar( |
| 88 | name = "protobuf-java-bundle", |
| 89 | jar = "@com_google_protobuf//:protobuf_java", |
| 90 | visibility = ["//visibility:public"], |
| 91 | deps = [], |
Carmelo Cascone | 6a1ae71 | 2018-08-10 12:19:47 -0700 | [diff] [blame] | 92 | ) |