mirror of https://github.com/grpc/grpc-java.git
Apply java plugin explicitly when needed
This commit is contained in:
parent
e13221b503
commit
4215b80b81
|
|
@ -1,4 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
|
id "java"
|
||||||
id "maven-publish"
|
id "maven-publish"
|
||||||
|
|
||||||
id "com.github.kt3k.coveralls"
|
id "com.github.kt3k.coveralls"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
|
id "java"
|
||||||
id "maven-publish"
|
id "maven-publish"
|
||||||
|
|
||||||
id "com.github.johnrengelman.shadow"
|
id "com.github.johnrengelman.shadow"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
|
id "java"
|
||||||
id "maven-publish"
|
id "maven-publish"
|
||||||
|
|
||||||
id "me.champeau.gradle.jmh"
|
id "me.champeau.gradle.jmh"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
|
id "java"
|
||||||
id "maven-publish"
|
id "maven-publish"
|
||||||
|
|
||||||
id "me.champeau.gradle.japicmp"
|
id "me.champeau.gradle.japicmp"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
plugins {
|
plugins {
|
||||||
id "application"
|
id "application"
|
||||||
|
id "java"
|
||||||
id "maven-publish"
|
id "maven-publish"
|
||||||
|
|
||||||
id "com.google.protobuf"
|
id "com.google.protobuf"
|
||||||
|
|
|
||||||
181
build.gradle
181
build.gradle
|
|
@ -9,7 +9,6 @@ import net.ltgt.gradle.errorprone.CheckSeverity
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
apply plugin: "checkstyle"
|
apply plugin: "checkstyle"
|
||||||
apply plugin: "java"
|
|
||||||
apply plugin: "maven"
|
apply plugin: "maven"
|
||||||
apply plugin: "idea"
|
apply plugin: "idea"
|
||||||
apply plugin: "signing"
|
apply plugin: "signing"
|
||||||
|
|
@ -20,30 +19,10 @@ subprojects {
|
||||||
apply plugin: "ru.vyarus.animalsniffer"
|
apply plugin: "ru.vyarus.animalsniffer"
|
||||||
|
|
||||||
apply plugin: "net.ltgt.errorprone"
|
apply plugin: "net.ltgt.errorprone"
|
||||||
if (rootProject.properties.get('errorProne', true)) {
|
|
||||||
dependencies {
|
|
||||||
errorprone 'com.google.errorprone:error_prone_core:2.3.3'
|
|
||||||
errorproneJavac 'com.google.errorprone:javac:9+181-r4173-1'
|
|
||||||
|
|
||||||
annotationProcessor 'com.google.guava:guava-beta-checker:1.0'
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// Disable Error Prone
|
|
||||||
allprojects {
|
|
||||||
afterEvaluate { project ->
|
|
||||||
project.tasks.withType(JavaCompile) {
|
|
||||||
options.errorprone.enabled = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
group = "io.grpc"
|
group = "io.grpc"
|
||||||
version = "1.25.0-SNAPSHOT" // CURRENT_GRPC_VERSION
|
version = "1.25.0-SNAPSHOT" // CURRENT_GRPC_VERSION
|
||||||
|
|
||||||
sourceCompatibility = 1.7
|
|
||||||
targetCompatibility = 1.7
|
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven { // The google mirror is less flaky than mavenCentral()
|
maven { // The google mirror is less flaky than mavenCentral()
|
||||||
url "https://maven-central.storage-download.googleapis.com/repos/central/data/" }
|
url "https://maven-central.storage-download.googleapis.com/repos/central/data/" }
|
||||||
|
|
@ -63,31 +42,6 @@ subprojects {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
compileTestJava {
|
|
||||||
// serialVersionUID is basically guaranteed to be useless in our tests
|
|
||||||
options.compilerArgs += [
|
|
||||||
"-Xlint:-serial"
|
|
||||||
]
|
|
||||||
// LinkedList doesn't hurt much in tests and has lots of usages
|
|
||||||
options.errorprone.check("JdkObsolete", CheckSeverity.OFF)
|
|
||||||
}
|
|
||||||
|
|
||||||
jar.manifest {
|
|
||||||
attributes('Implementation-Title': name,
|
|
||||||
'Implementation-Version': version,
|
|
||||||
'Built-By': System.getProperty('user.name'),
|
|
||||||
'Built-JDK': System.getProperty('java.version'),
|
|
||||||
'Source-Compatibility': sourceCompatibility,
|
|
||||||
'Target-Compatibility': targetCompatibility)
|
|
||||||
}
|
|
||||||
|
|
||||||
javadoc.options {
|
|
||||||
encoding = 'UTF-8'
|
|
||||||
use = true
|
|
||||||
links 'https://docs.oracle.com/javase/8/docs/api/'
|
|
||||||
source = "8"
|
|
||||||
}
|
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
def exeSuffix = osdetector.os == 'windows' ? ".exe" : ""
|
def exeSuffix = osdetector.os == 'windows' ? ".exe" : ""
|
||||||
protocPluginBaseName = 'protoc-gen-grpc-java'
|
protocPluginBaseName = 'protoc-gen-grpc-java'
|
||||||
|
|
@ -233,12 +187,6 @@ subprojects {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
|
||||||
testCompile libraries.junit,
|
|
||||||
libraries.mockito,
|
|
||||||
libraries.truth
|
|
||||||
}
|
|
||||||
|
|
||||||
// Disable JavaDoc doclint on Java 8. It's annoying.
|
// Disable JavaDoc doclint on Java 8. It's annoying.
|
||||||
if (JavaVersion.current().isJava8Compatible()) {
|
if (JavaVersion.current().isJava8Compatible()) {
|
||||||
allprojects {
|
allprojects {
|
||||||
|
|
@ -268,12 +216,81 @@ subprojects {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
checkstyleMain {
|
plugins.withId("java") {
|
||||||
source = fileTree(dir: "src/main", include: "**/*.java")
|
sourceCompatibility = 1.7
|
||||||
}
|
targetCompatibility = 1.7
|
||||||
|
|
||||||
checkstyleTest {
|
dependencies {
|
||||||
source = fileTree(dir: "src/test", include: "**/*.java")
|
testCompile libraries.junit,
|
||||||
|
libraries.mockito,
|
||||||
|
libraries.truth
|
||||||
|
}
|
||||||
|
|
||||||
|
compileTestJava {
|
||||||
|
// serialVersionUID is basically guaranteed to be useless in our tests
|
||||||
|
options.compilerArgs += [
|
||||||
|
"-Xlint:-serial"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
jar.manifest {
|
||||||
|
attributes('Implementation-Title': name,
|
||||||
|
'Implementation-Version': version,
|
||||||
|
'Built-By': System.getProperty('user.name'),
|
||||||
|
'Built-JDK': System.getProperty('java.version'),
|
||||||
|
'Source-Compatibility': sourceCompatibility,
|
||||||
|
'Target-Compatibility': targetCompatibility)
|
||||||
|
}
|
||||||
|
|
||||||
|
javadoc.options {
|
||||||
|
encoding = 'UTF-8'
|
||||||
|
use = true
|
||||||
|
links 'https://docs.oracle.com/javase/8/docs/api/'
|
||||||
|
source = "8"
|
||||||
|
}
|
||||||
|
|
||||||
|
checkstyleMain {
|
||||||
|
source = fileTree(dir: "src/main", include: "**/*.java")
|
||||||
|
}
|
||||||
|
|
||||||
|
checkstyleTest {
|
||||||
|
source = fileTree(dir: "src/test", include: "**/*.java")
|
||||||
|
}
|
||||||
|
|
||||||
|
// At a test failure, log the stack trace to the console so that we don't
|
||||||
|
// have to open the HTML in a browser.
|
||||||
|
test {
|
||||||
|
testLogging {
|
||||||
|
exceptionFormat = 'full'
|
||||||
|
showExceptions true
|
||||||
|
showCauses true
|
||||||
|
showStackTraces true
|
||||||
|
}
|
||||||
|
maxHeapSize = '1500m'
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rootProject.properties.get('errorProne', true)) {
|
||||||
|
dependencies {
|
||||||
|
errorprone 'com.google.errorprone:error_prone_core:2.3.3'
|
||||||
|
errorproneJavac 'com.google.errorprone:javac:9+181-r4173-1'
|
||||||
|
|
||||||
|
annotationProcessor 'com.google.guava:guava-beta-checker:1.0'
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Disable Error Prone
|
||||||
|
allprojects {
|
||||||
|
afterEvaluate { project ->
|
||||||
|
project.tasks.withType(JavaCompile) {
|
||||||
|
options.errorprone.enabled = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compileTestJava {
|
||||||
|
// LinkedList doesn't hurt much in tests and has lots of usages
|
||||||
|
options.errorprone.check("JdkObsolete", CheckSeverity.OFF)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins.withId("me.champeau.gradle.jmh") {
|
plugins.withId("me.champeau.gradle.jmh") {
|
||||||
|
|
@ -300,27 +317,10 @@ subprojects {
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins.withId("maven-publish") {
|
plugins.withId("maven-publish") {
|
||||||
task javadocJar(type: Jar) {
|
|
||||||
classifier = 'javadoc'
|
|
||||||
from javadoc
|
|
||||||
}
|
|
||||||
|
|
||||||
task sourcesJar(type: Jar) {
|
|
||||||
classifier = 'sources'
|
|
||||||
from sourceSets.main.allSource
|
|
||||||
}
|
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
// do not use mavenJava, as java plugin will modify it via "magic"
|
// do not use mavenJava, as java plugin will modify it via "magic"
|
||||||
maven(MavenPublication) {
|
maven(MavenPublication) {
|
||||||
if (project.name != 'grpc-netty-shaded') {
|
|
||||||
from components.java
|
|
||||||
}
|
|
||||||
|
|
||||||
artifact javadocJar
|
|
||||||
artifact sourcesJar
|
|
||||||
|
|
||||||
pom {
|
pom {
|
||||||
name = project.group + ":" + project.name
|
name = project.group + ":" + project.name
|
||||||
url = 'https://github.com/grpc/grpc-java'
|
url = 'https://github.com/grpc/grpc-java'
|
||||||
|
|
@ -400,18 +400,31 @@ subprojects {
|
||||||
required false
|
required false
|
||||||
sign publishing.publications.maven
|
sign publishing.publications.maven
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// At a test failure, log the stack trace to the console so that we don't
|
plugins.withId("java") {
|
||||||
// have to open the HTML in a browser.
|
task javadocJar(type: Jar) {
|
||||||
test {
|
classifier = 'javadoc'
|
||||||
testLogging {
|
from javadoc
|
||||||
exceptionFormat = 'full'
|
}
|
||||||
showExceptions true
|
|
||||||
showCauses true
|
task sourcesJar(type: Jar) {
|
||||||
showStackTraces true
|
classifier = 'sources'
|
||||||
|
from sourceSets.main.allSource
|
||||||
|
}
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
publications {
|
||||||
|
maven {
|
||||||
|
if (project.name != 'grpc-netty-shaded') {
|
||||||
|
from components.java
|
||||||
|
}
|
||||||
|
|
||||||
|
artifact javadocJar
|
||||||
|
artifact sourcesJar
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
maxHeapSize = '1500m'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run with: ./gradlew japicmp --continue
|
// Run with: ./gradlew japicmp --continue
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
plugins {
|
plugins {
|
||||||
id "cpp"
|
id "cpp"
|
||||||
|
id "java"
|
||||||
id "maven-publish"
|
id "maven-publish"
|
||||||
|
|
||||||
id "com.google.protobuf"
|
id "com.google.protobuf"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
|
id "java"
|
||||||
id "maven-publish"
|
id "maven-publish"
|
||||||
|
|
||||||
id "me.champeau.gradle.japicmp"
|
id "me.champeau.gradle.japicmp"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
|
id "java"
|
||||||
id "maven-publish"
|
id "maven-publish"
|
||||||
|
|
||||||
id "me.champeau.gradle.japicmp"
|
id "me.champeau.gradle.japicmp"
|
||||||
|
|
@ -7,6 +8,9 @@ plugins {
|
||||||
|
|
||||||
description = 'gRPC: Core'
|
description = 'gRPC: Core'
|
||||||
|
|
||||||
|
evaluationDependsOn(project(':grpc-context').path)
|
||||||
|
evaluationDependsOn(project(':grpc-api').path)
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':grpc-api'),
|
compile project(':grpc-api'),
|
||||||
libraries.gson,
|
libraries.gson,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
|
id "java"
|
||||||
id "maven-publish"
|
id "maven-publish"
|
||||||
|
|
||||||
id "com.google.protobuf"
|
id "com.google.protobuf"
|
||||||
|
|
@ -7,6 +8,8 @@ plugins {
|
||||||
|
|
||||||
description = "gRPC: GRPCLB LoadBalancer plugin"
|
description = "gRPC: GRPCLB LoadBalancer plugin"
|
||||||
|
|
||||||
|
evaluationDependsOn(project(':grpc-core').path)
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':grpc-core'),
|
compile project(':grpc-core'),
|
||||||
project(':grpc-protobuf'),
|
project(':grpc-protobuf'),
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
plugins {
|
plugins {
|
||||||
id "application"
|
id "application"
|
||||||
|
id "java"
|
||||||
id "maven-publish"
|
id "maven-publish"
|
||||||
|
|
||||||
id "com.google.protobuf"
|
id "com.google.protobuf"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
|
id "java"
|
||||||
id "maven-publish"
|
id "maven-publish"
|
||||||
|
|
||||||
id "me.champeau.gradle.japicmp"
|
id "me.champeau.gradle.japicmp"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
|
id "java"
|
||||||
id "maven-publish"
|
id "maven-publish"
|
||||||
|
|
||||||
id "com.github.johnrengelman.shadow"
|
id "com.github.johnrengelman.shadow"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
|
id "java"
|
||||||
id "maven-publish"
|
id "maven-publish"
|
||||||
|
|
||||||
id "me.champeau.gradle.japicmp"
|
id "me.champeau.gradle.japicmp"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
|
id "java"
|
||||||
id "maven-publish"
|
id "maven-publish"
|
||||||
|
|
||||||
id "com.google.protobuf"
|
id "com.google.protobuf"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
|
id "java"
|
||||||
id "maven-publish"
|
id "maven-publish"
|
||||||
|
|
||||||
id "com.google.protobuf"
|
id "com.google.protobuf"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
|
id "java"
|
||||||
id "maven-publish"
|
id "maven-publish"
|
||||||
|
|
||||||
id "com.google.protobuf"
|
id "com.google.protobuf"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
|
id "java"
|
||||||
id "maven-publish"
|
id "maven-publish"
|
||||||
|
|
||||||
id "me.champeau.gradle.japicmp"
|
id "me.champeau.gradle.japicmp"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
|
id "java"
|
||||||
id "maven-publish"
|
id "maven-publish"
|
||||||
|
|
||||||
id "com.google.protobuf"
|
id "com.google.protobuf"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
|
id "java"
|
||||||
id "maven-publish"
|
id "maven-publish"
|
||||||
|
|
||||||
id "me.champeau.gradle.japicmp"
|
id "me.champeau.gradle.japicmp"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
|
id "java"
|
||||||
id "maven-publish"
|
id "maven-publish"
|
||||||
|
|
||||||
id "com.github.johnrengelman.shadow"
|
id "com.github.johnrengelman.shadow"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue