mirror of https://github.com/grpc/grpc-java.git
bazel: Export deps from maven stand-in targets
If an artifact on Maven Central exposes a type from gRPC on its API surface, then consumers of that artifact need that gRPC API in the compile classpath. Bazel handles this by making hjars for transitive dependencies, but if the dependencies are runtime_deps then Bazel won't generate hjars containing the needed symbols. We don't export netty-shaded because the classes already don't match Maven Central. If an artifact on Maven Central is exposing a netty-shaded class on its API surface, it wouldn't work anyway since the class simply doesn't exist for the Bazel build. Fixes #9772
This commit is contained in:
parent
51ee3eb6ab
commit
f0614e5a76
|
|
@ -65,13 +65,12 @@ java_library(
|
||||||
)
|
)
|
||||||
|
|
||||||
# Mirrors the dependencies included in the artifact on Maven Central for usage
|
# Mirrors the dependencies included in the artifact on Maven Central for usage
|
||||||
# with maven_install's override_targets. Purposefully does not export any
|
# with maven_install's override_targets. Should only be used as a dep for
|
||||||
# symbols, as it should only be used as a dep for pre-compiled binaries on
|
# pre-compiled binaries on Maven Central.
|
||||||
# Maven Central.
|
|
||||||
java_library(
|
java_library(
|
||||||
name = "core_maven",
|
name = "core_maven",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
runtime_deps = [
|
exports = [
|
||||||
":inprocess",
|
":inprocess",
|
||||||
":internal",
|
":internal",
|
||||||
":util",
|
":util",
|
||||||
|
|
|
||||||
|
|
@ -20,20 +20,21 @@ java_library(
|
||||||
"@io_netty_netty_codec_http2//jar",
|
"@io_netty_netty_codec_http2//jar",
|
||||||
"@io_netty_netty_codec_socks//jar",
|
"@io_netty_netty_codec_socks//jar",
|
||||||
"@io_netty_netty_common//jar",
|
"@io_netty_netty_common//jar",
|
||||||
"@io_netty_netty_transport_native_unix_common//jar",
|
|
||||||
"@io_netty_netty_handler//jar",
|
"@io_netty_netty_handler//jar",
|
||||||
"@io_netty_netty_handler_proxy//jar",
|
"@io_netty_netty_handler_proxy//jar",
|
||||||
"@io_netty_netty_resolver//jar",
|
"@io_netty_netty_resolver//jar",
|
||||||
"@io_netty_netty_transport//jar",
|
"@io_netty_netty_transport//jar",
|
||||||
|
"@io_netty_netty_transport_native_unix_common//jar",
|
||||||
"@io_perfmark_perfmark_api//jar",
|
"@io_perfmark_perfmark_api//jar",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
# Mirrors the dependencies included in the artifact on Maven Central for usage
|
# Mirrors the dependencies included in the artifact on Maven Central for usage
|
||||||
# with maven_install's override_targets. Purposefully does not export any
|
# with maven_install's override_targets. Should only be used as a dep for
|
||||||
# symbols, as it should only be used as a dep for pre-compiled binaries on
|
# pre-compiled binaries on Maven Central.
|
||||||
# Maven Central. Not actually shaded; libraries should not be referencing
|
#
|
||||||
# unstable APIs so there should not be any references to the shaded package.
|
# Not actually shaded; libraries should not be referencing unstable APIs so
|
||||||
|
# there should not be any references to the shaded package.
|
||||||
java_library(
|
java_library(
|
||||||
name = "shaded_maven",
|
name = "shaded_maven",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,11 @@ load("//:java_grpc_library.bzl", "java_grpc_library")
|
||||||
package(default_visibility = ["//visibility:public"])
|
package(default_visibility = ["//visibility:public"])
|
||||||
|
|
||||||
# Mirrors the dependencies included in the artifact on Maven Central for usage
|
# Mirrors the dependencies included in the artifact on Maven Central for usage
|
||||||
# with maven_install's override_targets. Purposefully does not export any
|
# with maven_install's override_targets. Should only be used as a dep for
|
||||||
# symbols, as it should only be used as a dep for pre-compiled binaries on
|
# pre-compiled binaries on Maven Central.
|
||||||
# Maven Central.
|
|
||||||
java_library(
|
java_library(
|
||||||
name = "services_maven",
|
name = "services_maven",
|
||||||
runtime_deps = [
|
exports = [
|
||||||
":admin",
|
":admin",
|
||||||
":binarylog",
|
":binarylog",
|
||||||
":channelz",
|
":channelz",
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,12 @@
|
||||||
load("//:java_grpc_library.bzl", "java_grpc_library")
|
load("//:java_grpc_library.bzl", "java_grpc_library")
|
||||||
|
|
||||||
# Mirrors the dependencies included in the artifact on Maven Central for usage
|
# Mirrors the dependencies included in the artifact on Maven Central for usage
|
||||||
# with maven_install's override_targets. Purposefully does not export any
|
# with maven_install's override_targets. Should only be used as a dep for
|
||||||
# symbols, as it should only be used as a dep for pre-compiled binaries on
|
# pre-compiled binaries on Maven Central.
|
||||||
# Maven Central.
|
|
||||||
java_library(
|
java_library(
|
||||||
name = "xds_maven",
|
name = "xds_maven",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
runtime_deps = [
|
exports = [
|
||||||
":orca",
|
":orca",
|
||||||
":xds",
|
":xds",
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue