| plugins { |
| id "java-library" |
| id "java-test-fixtures" |
| id "maven-publish" |
| |
| id "me.champeau.jmh" |
| id "ru.vyarus.animalsniffer" |
| } |
| |
| description = 'gRPC: API' |
| |
| sourceSets { |
| context |
| main { |
| output.classesDirs.from(sourceSets.context.output.classesDirs) |
| } |
| } |
| |
| tasks.named("compileContextJava").configure { |
| if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_20)) { |
| println("!!! Javac does not support generating Java 7 bytecode. Do not use for release builds !!!") |
| } else if (JavaVersion.current().isJava9Compatible()) { |
| options.release = 7 |
| } else { |
| sourceCompatibility = JavaVersion.VERSION_1_7 |
| targetCompatibility = JavaVersion.VERSION_1_7 |
| } |
| } |
| |
| tasks.named("jar").configure { |
| manifest { |
| attributes('Automatic-Module-Name': 'io.grpc') |
| } |
| } |
| |
| dependencies { |
| compileOnly sourceSets.context.output |
| api libraries.jsr305, |
| libraries.errorprone.annotations |
| implementation libraries.guava |
| |
| testFixturesApi libraries.truth |
| testFixturesImplementation libraries.jsr305 |
| testFixturesImplementation libraries.guava, |
| libraries.junit, |
| libraries.mockito.core |
| testImplementation project(':grpc-testing'), |
| project(':grpc-grpclb') |
| testImplementation libraries.guava.testlib |
| jmh project(':grpc-core') |
| |
| signature libraries.signature.java |
| signature libraries.signature.android |
| } |
| |
| tasks.named("javadoc").configure { |
| source sourceSets.context.allSource |
| // We want io.grpc.Internal, but not io.grpc.Internal* |
| exclude 'io/grpc/Internal?*.java' |
| } |
| |
| tasks.named("sourcesJar").configure { |
| from sourceSets.context.allSource |
| } |
| |
| components.java.withVariantsFromConfiguration(configurations.testFixturesApiElements) { skip() } |
| components.java.withVariantsFromConfiguration(configurations.testFixturesRuntimeElements) { skip() } |