2019-09-07 23:18:57 +08:00
|
|
|
plugins {
|
2020-05-05 07:44:30 +08:00
|
|
|
id "java-library"
|
2019-09-08 00:27:32 +08:00
|
|
|
id "maven-publish"
|
|
|
|
|
2019-09-07 23:18:57 +08:00
|
|
|
id "com.github.johnrengelman.shadow"
|
|
|
|
id "com.google.protobuf"
|
2019-09-08 01:38:58 +08:00
|
|
|
id "ru.vyarus.animalsniffer"
|
2018-08-16 08:39:20 +08:00
|
|
|
}
|
|
|
|
|
2018-02-16 01:28:00 +08:00
|
|
|
description = "gRPC: ALTS"
|
|
|
|
|
|
|
|
dependencies {
|
2023-12-16 07:14:29 +08:00
|
|
|
api project(':grpc-api')
|
2020-05-05 07:44:30 +08:00
|
|
|
implementation project(':grpc-auth'),
|
2023-12-16 07:14:29 +08:00
|
|
|
project(':grpc-core'),
|
2024-03-12 05:00:12 +08:00
|
|
|
project(":grpc-context"), // Override google-auth dependency with our newer version
|
2020-03-03 02:27:57 +08:00
|
|
|
project(':grpc-grpclb'),
|
2018-02-16 01:28:00 +08:00
|
|
|
project(':grpc-protobuf'),
|
|
|
|
project(':grpc-stub'),
|
2022-06-14 03:09:30 +08:00
|
|
|
libraries.protobuf.java,
|
2021-06-12 05:01:18 +08:00
|
|
|
libraries.conscrypt,
|
2023-04-13 23:52:20 +08:00
|
|
|
libraries.guava.jre, // JRE required by protobuf-java-util from grpclb
|
2022-06-14 03:09:30 +08:00
|
|
|
libraries.google.auth.oauth2Http
|
2020-05-05 07:44:30 +08:00
|
|
|
def nettyDependency = implementation project(':grpc-netty')
|
2022-06-14 03:09:30 +08:00
|
|
|
compileOnly libraries.javax.annotation
|
2020-03-05 08:10:46 +08:00
|
|
|
|
2020-05-05 07:44:30 +08:00
|
|
|
shadow configurations.implementation.getDependencies().minus(nettyDependency)
|
2020-03-05 08:10:46 +08:00
|
|
|
shadow project(path: ':grpc-netty-shaded', configuration: 'shadow')
|
|
|
|
|
2020-05-05 07:44:30 +08:00
|
|
|
testImplementation project(':grpc-testing'),
|
2023-05-17 03:10:13 +08:00
|
|
|
testFixtures(project(':grpc-core')),
|
2023-12-16 07:14:29 +08:00
|
|
|
project(':grpc-inprocess'),
|
2018-12-19 09:51:54 +08:00
|
|
|
project(':grpc-testing-proto'),
|
|
|
|
libraries.guava,
|
2018-06-12 09:35:18 +08:00
|
|
|
libraries.junit,
|
2022-06-14 03:09:30 +08:00
|
|
|
libraries.mockito.core,
|
2018-06-12 09:35:18 +08:00
|
|
|
libraries.truth
|
2020-06-04 04:48:02 +08:00
|
|
|
|
2023-06-23 22:55:20 +08:00
|
|
|
testImplementation libraries.guava.testlib
|
2022-06-25 01:47:27 +08:00
|
|
|
testRuntimeOnly libraries.netty.tcnative,
|
|
|
|
libraries.netty.tcnative.classes
|
2022-06-14 03:09:30 +08:00
|
|
|
testRuntimeOnly (libraries.netty.transport.epoll) {
|
2022-06-12 01:40:02 +08:00
|
|
|
artifact {
|
|
|
|
classifier = "linux-x86_64"
|
|
|
|
}
|
|
|
|
}
|
2022-08-11 03:41:57 +08:00
|
|
|
signature libraries.signature.java
|
2018-02-16 01:28:00 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
configureProtoCompilation()
|
|
|
|
|
2018-12-14 02:17:06 +08:00
|
|
|
import net.ltgt.gradle.errorprone.CheckSeverity
|
|
|
|
|
2022-07-02 06:48:38 +08:00
|
|
|
[tasks.named("compileJava"), tasks.named("compileTestJava")]*.configure {
|
2018-12-14 02:17:06 +08:00
|
|
|
// ALTS returns a lot of futures that we mostly don't care about.
|
2022-07-02 06:48:38 +08:00
|
|
|
options.errorprone.check("FutureReturnValueIgnored", CheckSeverity.OFF)
|
2018-02-16 01:28:00 +08:00
|
|
|
}
|
|
|
|
|
2022-07-02 06:48:38 +08:00
|
|
|
tasks.named("javadoc").configure {
|
2021-02-24 04:27:47 +08:00
|
|
|
exclude 'io/grpc/alts/internal/**'
|
|
|
|
exclude 'io/grpc/alts/Internal*'
|
|
|
|
}
|
2018-08-16 08:39:20 +08:00
|
|
|
|
2022-07-02 06:48:38 +08:00
|
|
|
tasks.named("jar").configure {
|
2022-01-19 02:18:16 +08:00
|
|
|
// Must use a different archiveClassifier to avoid conflicting with shadowJar
|
|
|
|
archiveClassifier = 'original'
|
2023-07-26 00:00:11 +08:00
|
|
|
manifest {
|
|
|
|
attributes('Automatic-Module-Name': 'io.grpc.alts')
|
|
|
|
}
|
2018-08-16 08:39:20 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// We want to use grpc-netty-shaded instead of grpc-netty. But we also want our
|
|
|
|
// source to work with Bazel, so we rewrite the code as part of the build.
|
2022-07-02 06:48:38 +08:00
|
|
|
tasks.named("shadowJar").configure {
|
2022-01-19 02:18:16 +08:00
|
|
|
archiveClassifier = null
|
2018-08-16 08:39:20 +08:00
|
|
|
dependencies {
|
|
|
|
exclude(dependency {true})
|
|
|
|
}
|
|
|
|
relocate 'io.grpc.netty', 'io.grpc.netty.shaded.io.grpc.netty'
|
|
|
|
relocate 'io.netty', 'io.grpc.netty.shaded.io.netty'
|
|
|
|
}
|
|
|
|
|
2019-02-01 09:38:43 +08:00
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
maven(MavenPublication) {
|
2020-12-18 07:02:27 +08:00
|
|
|
// We want this to throw an exception if it isn't working
|
2019-02-02 03:02:16 +08:00
|
|
|
def originalJar = artifacts.find { dep -> dep.classifier == 'original'}
|
|
|
|
artifacts.remove(originalJar)
|
2019-02-01 09:38:43 +08:00
|
|
|
|
|
|
|
pom.withXml {
|
2020-03-05 08:10:46 +08:00
|
|
|
def dependenciesNode = new Node(null, 'dependencies')
|
|
|
|
project.configurations.shadow.allDependencies.each { dep ->
|
|
|
|
def dependencyNode = dependenciesNode.appendNode('dependency')
|
|
|
|
dependencyNode.appendNode('groupId', dep.group)
|
|
|
|
dependencyNode.appendNode('artifactId', dep.name)
|
2023-05-07 07:17:10 +08:00
|
|
|
dependencyNode.appendNode('version', dep.version)
|
2020-03-05 08:10:46 +08:00
|
|
|
dependencyNode.appendNode('scope', 'compile')
|
2019-02-01 09:38:43 +08:00
|
|
|
}
|
2020-03-05 08:10:46 +08:00
|
|
|
asNode().dependencies[0].replaceNode(dependenciesNode)
|
2019-02-01 09:38:43 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-08-16 08:39:20 +08:00
|
|
|
}
|