mirror of https://github.com/grpc/grpc-java.git
Upgrade to protobuf lite 3.10
This finally brings lite into version number sync with full proto. Well-known protos for javalite are now pre-generated.
This commit is contained in:
parent
b38134eebd
commit
48929c4d50
|
@ -41,14 +41,15 @@ android {
|
|||
protobuf {
|
||||
protoc { artifact = 'com.google.protobuf:protoc:3.10.0' }
|
||||
plugins {
|
||||
javalite { artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0" }
|
||||
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.26.0-SNAPSHOT' // CURRENT_GRPC_VERSION
|
||||
}
|
||||
}
|
||||
generateProtoTasks {
|
||||
all().each { task ->
|
||||
task.builtins {
|
||||
java { option 'lite' }
|
||||
}
|
||||
task.plugins {
|
||||
javalite {}
|
||||
grpc {
|
||||
// Options added to --grpc_out
|
||||
option 'lite'
|
||||
|
@ -77,9 +78,6 @@ dependencies {
|
|||
implementation 'io.grpc:grpc-stub:1.26.0-SNAPSHOT' // CURRENT_GRPC_VERSION
|
||||
implementation 'io.grpc:grpc-testing:1.26.0-SNAPSHOT' // CURRENT_GRPC_VERSION
|
||||
|
||||
// workaround for https://github.com/google/protobuf/issues/1889
|
||||
protobuf 'com.google.protobuf:protobuf-java:3.0.2'
|
||||
|
||||
androidTestImplementation 'androidx.test:rules:1.1.0-alpha1'
|
||||
androidTestImplementation 'androidx.test:runner:1.1.0-alpha1'
|
||||
}
|
||||
|
|
|
@ -105,11 +105,6 @@ subprojects {
|
|||
}
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
// Protobuf-generated code produces some warnings.
|
||||
// https://github.com/google/protobuf/issues/2718
|
||||
it.options.compilerArgs += [
|
||||
"-Xlint:-cast",
|
||||
]
|
||||
it.options.errorprone.excludedPaths = ".*/src/generated/[^/]+/java/.*" +
|
||||
"|.*/build/generated/source/proto/[^/]+/java/.*"
|
||||
}
|
||||
|
@ -137,8 +132,7 @@ subprojects {
|
|||
perfmark: 'io.perfmark:perfmark-api:0.19.0',
|
||||
pgv: 'io.envoyproxy.protoc-gen-validate:pgv-java-stub:0.2.0',
|
||||
protobuf: "com.google.protobuf:protobuf-java:${protobufVersion}",
|
||||
protobuf_lite: "com.google.protobuf:protobuf-lite:3.0.1",
|
||||
protoc_lite: "com.google.protobuf:protoc-gen-javalite:3.0.0",
|
||||
protobuf_lite: "com.google.protobuf:protobuf-javalite:${protobufVersion}",
|
||||
protobuf_util: "com.google.protobuf:protobuf-java-util:${protobufVersion}",
|
||||
lang: "org.apache.commons:commons-lang3:3.5",
|
||||
|
||||
|
|
|
@ -142,19 +142,13 @@ sourceSets {
|
|||
}
|
||||
|
||||
compileTestJava {
|
||||
options.compilerArgs += [
|
||||
"-Xlint:-cast"
|
||||
]
|
||||
options.errorprone.excludedPaths = ".*/build/generated/source/proto/.*"
|
||||
}
|
||||
|
||||
compileTestLiteJava {
|
||||
options.compilerArgs = compileTestJava.options.compilerArgs
|
||||
// Protobuf-generated Lite produces quite a few warnings.
|
||||
options.compilerArgs += [
|
||||
"-Xlint:-rawtypes",
|
||||
"-Xlint:-unchecked",
|
||||
"-Xlint:-fallthrough"
|
||||
"-Xlint:-cast"
|
||||
]
|
||||
options.errorprone.excludedPaths = ".*/build/generated/source/proto/.*"
|
||||
}
|
||||
|
@ -168,13 +162,6 @@ protobuf {
|
|||
}
|
||||
}
|
||||
plugins {
|
||||
javalite {
|
||||
if (project.hasProperty('protoc-gen-javalite')) {
|
||||
path = project['protoc-gen-javalite']
|
||||
} else {
|
||||
artifact = libraries.protoc_lite
|
||||
}
|
||||
}
|
||||
grpc { path = javaPluginPath }
|
||||
}
|
||||
generateProtoTasks {
|
||||
|
@ -184,9 +171,10 @@ protobuf {
|
|||
}
|
||||
ofSourceSet('test')*.plugins { grpc {} }
|
||||
ofSourceSet('testLite')*.each { task ->
|
||||
task.builtins { remove java }
|
||||
task.builtins {
|
||||
java { option 'lite' }
|
||||
}
|
||||
task.plugins {
|
||||
javalite {}
|
||||
grpc { option 'lite' }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,16 +28,17 @@ android {
|
|||
}
|
||||
|
||||
protobuf {
|
||||
protoc { artifact = 'com.google.protobuf:protoc:3.4.0' }
|
||||
protoc { artifact = 'com.google.protobuf:protoc:3.10.0' }
|
||||
plugins {
|
||||
javalite { artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0" }
|
||||
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.26.0-SNAPSHOT' // CURRENT_GRPC_VERSION
|
||||
}
|
||||
}
|
||||
generateProtoTasks {
|
||||
all().each { task ->
|
||||
task.builtins {
|
||||
java { option 'lite' }
|
||||
}
|
||||
task.plugins {
|
||||
javalite {}
|
||||
grpc { // Options added to --grpc_out
|
||||
option 'lite' }
|
||||
}
|
||||
|
|
|
@ -29,14 +29,15 @@ android {
|
|||
protobuf {
|
||||
protoc { artifact = 'com.google.protobuf:protoc:3.10.0' }
|
||||
plugins {
|
||||
javalite { artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0" }
|
||||
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.26.0-SNAPSHOT' // CURRENT_GRPC_VERSION
|
||||
}
|
||||
}
|
||||
generateProtoTasks {
|
||||
all().each { task ->
|
||||
task.builtins {
|
||||
java { option 'lite' }
|
||||
}
|
||||
task.plugins {
|
||||
javalite {}
|
||||
grpc { // Options added to --grpc_out
|
||||
option 'lite' }
|
||||
}
|
||||
|
|
|
@ -28,14 +28,15 @@ android {
|
|||
protobuf {
|
||||
protoc { artifact = 'com.google.protobuf:protoc:3.10.0' }
|
||||
plugins {
|
||||
javalite { artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0" }
|
||||
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.26.0-SNAPSHOT' // CURRENT_GRPC_VERSION
|
||||
}
|
||||
}
|
||||
generateProtoTasks {
|
||||
all().each { task ->
|
||||
task.builtins {
|
||||
java { option 'lite' }
|
||||
}
|
||||
task.plugins {
|
||||
javalite {}
|
||||
grpc { // Options added to --grpc_out
|
||||
option 'lite' }
|
||||
}
|
||||
|
|
|
@ -29,14 +29,15 @@ android {
|
|||
protobuf {
|
||||
protoc { artifact = 'com.google.protobuf:protoc:3.10.0' }
|
||||
plugins {
|
||||
javalite { artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0" }
|
||||
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.26.0-SNAPSHOT' // CURRENT_GRPC_VERSION
|
||||
}
|
||||
}
|
||||
generateProtoTasks {
|
||||
all().each { task ->
|
||||
task.builtins {
|
||||
java { option 'lite' }
|
||||
}
|
||||
task.plugins {
|
||||
javalite {}
|
||||
grpc { // Options added to --grpc_out
|
||||
option 'lite' }
|
||||
}
|
||||
|
|
|
@ -51,14 +51,15 @@ android {
|
|||
protobuf {
|
||||
protoc { artifact = 'com.google.protobuf:protoc:3.10.0' }
|
||||
plugins {
|
||||
javalite { artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0" }
|
||||
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.26.0-SNAPSHOT' // CURRENT_GRPC_VERSION
|
||||
}
|
||||
}
|
||||
generateProtoTasks {
|
||||
all().each { task ->
|
||||
task.builtins {
|
||||
java { option 'lite' }
|
||||
}
|
||||
task.plugins {
|
||||
javalite {}
|
||||
grpc { // Options added to --grpc_out
|
||||
option 'lite' }
|
||||
}
|
||||
|
|
|
@ -22,18 +22,14 @@ dependencies {
|
|||
}
|
||||
|
||||
testCompile project(':grpc-core')
|
||||
testProtobuf libraries.protobuf
|
||||
|
||||
signature "org.codehaus.mojo.signature:java17:1.0@signature"
|
||||
signature "net.sf.androidscents.signature:android-api-level-14:4.0_r4@signature"
|
||||
}
|
||||
|
||||
compileTestJava {
|
||||
// Protobuf-generated Lite produces quite a few warnings.
|
||||
options.compilerArgs += [
|
||||
"-Xlint:-rawtypes",
|
||||
"-Xlint:-unchecked",
|
||||
"-Xlint:-fallthrough"
|
||||
"-Xlint:-cast"
|
||||
]
|
||||
options.errorprone.excludedPaths = ".*/build/generated/source/proto/.*"
|
||||
}
|
||||
|
@ -46,19 +42,11 @@ protobuf {
|
|||
artifact = "com.google.protobuf:protoc:${protocVersion}"
|
||||
}
|
||||
}
|
||||
plugins {
|
||||
javalite {
|
||||
if (project.hasProperty('protoc-gen-javalite')) {
|
||||
path = project['protoc-gen-javalite']
|
||||
} else {
|
||||
artifact = libraries.protoc_lite
|
||||
generateProtoTasks {
|
||||
ofSourceSet('test')*.each { task ->
|
||||
task.builtins {
|
||||
java { option 'lite' }
|
||||
}
|
||||
}
|
||||
}
|
||||
generateProtoTasks {
|
||||
ofSourceSet('test')*.each { task ->
|
||||
task.builtins { remove java }
|
||||
task.plugins { javalite {} }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue