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