plugins { id "java" id "maven-publish" id "com.github.johnrengelman.shadow" id "com.google.protobuf" id "ru.vyarus.animalsniffer" } description = "gRPC: XDS plugin" [compileJava].each() { it.options.compilerArgs += [ // valueOf(int) in RoutingPriority has been deprecated "-Xlint:-deprecation", ] } evaluationDependsOn(project(':grpc-core').path) dependencies { compile project(':grpc-protobuf'), project(':grpc-stub'), project(':grpc-core'), project(':grpc-netty'), project(':grpc-services'), project(':grpc-alts'), libraries.netty_epoll compile (libraries.pgv) { // PGV depends on com.google.protobuf:protobuf-java 3.6.1 conflicting with :grpc-protobuf exclude group: 'com.google.protobuf' } compile (libraries.protobuf_util) { // prefer our own versions instead of protobuf-util's dependency exclude group: 'com.google.guava', module: 'guava' exclude group: 'com.google.errorprone', module: 'error_prone_annotations' } testCompile project(':grpc-core').sourceSets.test.output compileOnly libraries.javax_annotation testCompile project(':grpc-testing'), project(':grpc-testing-proto'), libraries.guava_testlib signature "org.codehaus.mojo.signature:java17:1.0@signature" testRuntime libraries.netty_tcnative } sourceSets { main { proto { srcDir 'third_party/envoy/src/main/proto' srcDir 'third_party/udpa/src/main/proto' } } } configureProtoCompilation() jar { classifier = 'original' } javadoc { exclude 'io/grpc/xds/internal/**' } shadowJar { classifier = null dependencies { include(project(':grpc-xds')) include(dependency('io.envoyproxy.protoc-gen-validate:')) } relocate 'com.github.udpa', 'io.grpc.xds.shaded.com.github.udpa' relocate 'io.envoyproxy', 'io.grpc.xds.shaded.io.envoyproxy' relocate 'io.grpc.netty', 'io.grpc.netty.shaded.io.grpc.netty' relocate 'io.netty', 'io.grpc.netty.shaded.io.netty' exclude "**/*.proto" } publishing { publications { maven(MavenPublication) { artifact shadowJar artifacts.removeAll { it.classifier == 'original' } pom.withXml { // Swap our dependency to grpc-netty-shaded. Projects depending on this via // project(':grpc-xds') will still be using the non-shaded form. asNode().dependencies.'*'.findAll() { dep -> dep.artifactId.text() == 'grpc-netty' }.each() { netty -> netty.artifactId*.value = 'grpc-netty-shaded' netty.version*.value = "[" + netty.version.text() + "]" } } } } }