grpc-java/census/build.gradle

39 lines
1.0 KiB
Groovy
Raw Normal View History

2020-01-14 06:35:29 +08:00
plugins {
id "java-library"
2020-01-14 06:35:29 +08:00
id "maven-publish"
id "ru.vyarus.animalsniffer"
2020-01-14 06:35:29 +08:00
}
description = 'gRPC: Census'
tasks.named("jar").configure {
manifest {
attributes('Automatic-Module-Name': 'io.grpc.census')
}
}
2020-01-14 06:35:29 +08:00
dependencies {
api project(':grpc-api')
// force dependent jars to depend on latest grpc-context
runtimeOnly project(":grpc-context")
implementation libraries.guava,
alts,census,gcp-observability: Explicitly set grpc-context as an implementation dependency (#10997) Override google-auth `io.grpc:grpc-context` dependency with our own `project(":grpc-context")`. This fixes the issue with classes depending on `grpc-alts` implementation receiving very (!) old `io.grpc:grpc-context:1.27.2` as a transitive dependency of `com.google.auth`. Projects `grpc-census` `grpc-gcp-observability` are affected in the similar way, except `io.grpc:grpc-context:1.59.1` is pulled as a transitive dependency of `io.opencensus`. ### Before ``` ❯ ./gradlew -q :grpc-xds:dependencyInsight --configuration=compileClasspath --dependency=io.grpc:grpc-context *** Skipping the build of codegen and compilation of proto files because skipCodegen=true * Skipping the build of Android projects because skipAndroid=true io.grpc:grpc-context:1.27.2 Variant compile: | Attribute Name | Provided | Requested | |--------------------------------|----------|--------------| | org.gradle.status | release | | | org.gradle.category | library | library | | org.gradle.libraryelements | jar | classes | | org.gradle.usage | java-api | java-api | | org.gradle.dependency.bundling | | external | | org.gradle.jvm.environment | | standard-jvm | | org.gradle.jvm.version | | 8 | io.grpc:grpc-context:1.27.2 \--- io.opencensus:opencensus-api:0.31.1 +--- com.google.http-client:google-http-client:1.43.3 | +--- com.google.auth:google-auth-library-oauth2-http:1.22.0 | | \--- project :grpc-alts | | \--- compileClasspath | \--- com.google.http-client:google-http-client-gson:1.43.3 | \--- com.google.auth:google-auth-library-oauth2-http:1.22.0 (*) \--- io.opencensus:opencensus-contrib-http-util:0.31.1 \--- com.google.http-client:google-http-client:1.43.3 (*) (*) - Indicates repeated occurrences of a transitive dependency subtree. Gradle expands transitive dependency subtrees only once per project; repeat occurrences only display the root of the subtree, followed by this annotation. ``` ### After ``` ❯ ./gradlew -q :grpc-xds:dependencyInsight --configuration=compileClasspath --dependency=io.grpc:grpc-context *** Skipping the build of codegen and compilation of proto files because skipCodegen=true * Skipping the build of Android projects because skipAndroid=true project :grpc-context Variant apiElements: | Attribute Name | Provided | Requested | |--------------------------------|----------|--------------| | org.gradle.category | library | library | | org.gradle.dependency.bundling | external | external | | org.gradle.jvm.version | 8 | 8 | | org.gradle.libraryelements | jar | classes | | org.gradle.usage | java-api | java-api | | org.gradle.jvm.environment | | standard-jvm | Selection reasons: - By conflict resolution: between versions 1.63.0-SNAPSHOT and 1.27.2 project :grpc-context \--- project :grpc-alts \--- compileClasspath io.grpc:grpc-context:1.27.2 -> project :grpc-context \--- io.opencensus:opencensus-api:0.31.1 +--- com.google.http-client:google-http-client:1.43.3 | +--- com.google.auth:google-auth-library-oauth2-http:1.22.0 | | \--- project :grpc-alts | | \--- compileClasspath | \--- com.google.http-client:google-http-client-gson:1.43.3 | \--- com.google.auth:google-auth-library-oauth2-http:1.22.0 (*) \--- io.opencensus:opencensus-contrib-http-util:0.31.1 \--- com.google.http-client:google-http-client:1.43.3 (*) (*) - Indicates repeated occurrences of a transitive dependency subtree. Gradle expands transitive dependency subtrees only once per project; repeat occurrences only display the root of the subtree, followed by this annotation. ```
2024-03-12 05:00:12 +08:00
project(":grpc-context"), // Override opencensus dependency with our newer version
libraries.opencensus.api,
libraries.opencensus.contrib.grpc.metrics
testImplementation testFixtures(project(':grpc-api')),
testFixtures(project(':grpc-core')),
2020-01-14 06:35:29 +08:00
project(':grpc-testing'),
libraries.opencensus.impl
signature libraries.signature.java
signature libraries.signature.android
2020-01-14 06:35:29 +08:00
}
tasks.named("javadoc").configure {
2020-01-14 06:35:29 +08:00
failOnError false // no public or protected classes found to document
exclude 'io/grpc/census/internal/**'
exclude 'io/grpc/census/Internal*'
}