Skip to content

Commit d7e53e8

Browse files
authored
Merge pull request #5454 from ejona86/protobuf-3.7.0
Upgrade to Protobuf 3.7.0
1 parent 57e94d1 commit d7e53e8

File tree

24 files changed

+75
-37
lines changed

24 files changed

+75
-37
lines changed

COMPILING.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ For Linux, Mac and MinGW:
4444
```
4545
$ git clone https://github.com/google/protobuf.git
4646
$ cd protobuf
47-
$ git checkout v3.6.1
47+
$ git checkout v3.7.0
4848
$ ./autogen.sh
4949
$ ./configure
5050
$ make
@@ -83,16 +83,16 @@ When building on Windows and VC++, you need to specify project properties for
8383
Gradle to find protobuf:
8484
```
8585
.\gradlew publishToMavenLocal ^
86-
-PvcProtobufInclude=C:\path\to\protobuf-3.6.1\src ^
87-
-PvcProtobufLibs=C:\path\to\protobuf-3.6.1\vsprojects\Release ^
86+
-PvcProtobufInclude=C:\path\to\protobuf-3.7.0\src ^
87+
-PvcProtobufLibs=C:\path\to\protobuf-3.7.0\vsprojects\Release ^
8888
-PtargetArch=x86_32
8989
```
9090

9191
Since specifying those properties every build is bothersome, you can instead
9292
create ``<project-root>\gradle.properties`` with contents like:
9393
```
94-
vcProtobufInclude=C:\\path\\to\\protobuf-3.6.1\\src
95-
vcProtobufLibs=C:\\path\\to\\protobuf-3.6.1\\vsprojects\\Release
94+
vcProtobufInclude=C:\\path\\to\\protobuf-3.7.0\\src
95+
vcProtobufLibs=C:\\path\\to\\protobuf-3.7.0\\vsprojects\\Release
9696
targetArch=x86_32
9797
```
9898

android-interop-testing/app/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ android {
3939
}
4040

4141
protobuf {
42-
protoc { artifact = 'com.google.protobuf:protoc:3.6.1' }
42+
protoc { artifact = 'com.google.protobuf:protoc:3.7.0' }
4343
plugins {
4444
javalite { artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0" }
4545
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.20.0-SNAPSHOT' // CURRENT_GRPC_VERSION

build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ subprojects {
110110
nettyVersion = '4.1.34.Final'
111111
googleauthVersion = '0.13.0'
112112
guavaVersion = '26.0-android'
113-
protobufVersion = '3.6.1'
113+
protobufVersion = '3.7.0'
114114
protocVersion = protobufVersion
115115
protobufNanoVersion = '3.0.0-alpha-5'
116116
opencensusVersion = '0.19.2'
@@ -192,7 +192,7 @@ subprojects {
192192
libraries = [
193193
android_annotations: "com.google.android:annotations:4.1.1.4",
194194
animalsniffer_annotations: "org.codehaus.mojo:animal-sniffer-annotations:1.17",
195-
errorprone: "com.google.errorprone:error_prone_annotations:2.2.0",
195+
errorprone: "com.google.errorprone:error_prone_annotations:2.3.2",
196196
gson: "com.google.code.gson:gson:2.7",
197197
guava: "com.google.guava:guava:${guavaVersion}",
198198
hpack: 'com.twitter:hpack:0.10.1',

buildscripts/make_dependencies.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
set PROTOBUF_VER=3.6.1
1+
set PROTOBUF_VER=3.7.0
22
set CMAKE_NAME=cmake-3.3.2-win32-x86
33

44
if not exist "protobuf-%PROTOBUF_VER%\cmake\build\Release\" (

buildscripts/make_dependencies.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Build protoc
44
set -evux -o pipefail
55

6-
PROTOBUF_VERSION=3.6.1
6+
PROTOBUF_VERSION=3.7.0
77

88
# ARCH is 64 bit unless otherwise specified.
99
ARCH="${ARCH:-64}"

core/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dependencies {
88
libraries.android_annotations,
99
libraries.animalsniffer_annotations
1010
compile (libraries.guava) {
11-
// prefer 2.2.0 from libraries instead of 2.1.3
11+
// prefer 2.3.2 from libraries instead of 2.1.3
1212
exclude group: 'com.google.errorprone', module: 'error_prone_annotations'
1313
// prefer 3.0.2 from libraries instead of 3.0.1
1414
exclude group: 'com.google.code.findbugs', module: 'jsr305'

examples/android/helloworld/app/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ android {
2727
}
2828

2929
protobuf {
30-
protoc { artifact = 'com.google.protobuf:protoc:3.6.1' }
30+
protoc { artifact = 'com.google.protobuf:protoc:3.7.0' }
3131
plugins {
3232
javalite { artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0" }
3333
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.20.0-SNAPSHOT' // CURRENT_GRPC_VERSION

examples/android/routeguide/app/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ android {
2626
}
2727

2828
protobuf {
29-
protoc { artifact = 'com.google.protobuf:protoc:3.6.1' }
29+
protoc { artifact = 'com.google.protobuf:protoc:3.7.0' }
3030
plugins {
3131
javalite { artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0" }
3232
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.20.0-SNAPSHOT' // CURRENT_GRPC_VERSION

examples/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ targetCompatibility = 1.7
2323
// Feel free to delete the comment at the next line. It is just for safely
2424
// updating the version in our release process.
2525
def grpcVersion = '1.20.0-SNAPSHOT' // CURRENT_GRPC_VERSION
26-
def protobufVersion = '3.6.1'
26+
def protobufVersion = '3.7.0'
2727
def protocVersion = protobufVersion
2828

2929
dependencies {

examples/example-alts/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ targetCompatibility = 1.7
2323
// Feel free to delete the comment at the next line. It is just for safely
2424
// updating the version in our release process.
2525
def grpcVersion = '1.20.0-SNAPSHOT' // CURRENT_GRPC_VERSION
26-
def protocVersion = '3.6.1'
26+
def protocVersion = '3.7.0'
2727

2828
dependencies {
2929
// grpc-alts transitively depends on grpc-netty-shaded, grpc-protobuf, and grpc-stub

examples/example-gauth/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ targetCompatibility = 1.7
2323
// Feel free to delete the comment at the next line. It is just for safely
2424
// updating the version in our release process.
2525
def grpcVersion = '1.20.0-SNAPSHOT' // CURRENT_GRPC_VERSION
26-
def protobufVersion = '3.6.1'
26+
def protobufVersion = '3.7.0'
2727
def protocVersion = protobufVersion
2828

2929

examples/example-gauth/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<properties>
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1515
<grpc.version>1.20.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
16-
<protobuf.version>3.6.1</protobuf.version>
16+
<protobuf.version>3.7.0</protobuf.version>
1717
<!-- required for jdk9 -->
1818
<maven.compiler.source>1.7</maven.compiler.source>
1919
<maven.compiler.target>1.7</maven.compiler.target>

examples/example-kotlin/android/helloworld/app/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ android {
4949
}
5050

5151
protobuf {
52-
protoc { artifact = 'com.google.protobuf:protoc:3.6.1' }
52+
protoc { artifact = 'com.google.protobuf:protoc:3.7.0' }
5353
plugins {
5454
javalite { artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0" }
5555
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.20.0-SNAPSHOT' // CURRENT_GRPC_VERSION

examples/example-kotlin/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ dependencies {
3939
}
4040

4141
protobuf {
42-
protoc { artifact = 'com.google.protobuf:protoc:3.6.1' }
42+
protoc { artifact = 'com.google.protobuf:protoc:3.7.0' }
4343
plugins {
4444
grpc { artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" }
4545
}

examples/example-tls/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ targetCompatibility = 1.7
2424
// updating the version in our release process.
2525
def grpcVersion = '1.20.0-SNAPSHOT' // CURRENT_GRPC_VERSION
2626
def nettyTcNativeVersion = '2.0.20.Final'
27-
def protocVersion = '3.6.1'
27+
def protocVersion = '3.7.0'
2828

2929
dependencies {
3030
implementation "io.grpc:grpc-netty:${grpcVersion}"

examples/example-tls/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<properties>
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1515
<grpc.version>1.20.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
16-
<protoc.version>3.6.1</protoc.version>
16+
<protoc.version>3.7.0</protoc.version>
1717
<netty.tcnative.version>2.0.20.Final</netty.tcnative.version>
1818
<!-- required for jdk9 -->
1919
<maven.compiler.source>1.7</maven.compiler.source>

examples/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
<properties>
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1515
<grpc.version>1.20.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
16-
<protobuf.version>3.6.1</protobuf.version>
17-
<protoc.version>3.6.1</protoc.version>
16+
<protobuf.version>3.7.0</protobuf.version>
17+
<protoc.version>3.7.0</protoc.version>
1818
<!-- required for jdk9 -->
1919
<maven.compiler.source>1.7</maven.compiler.source>
2020
<maven.compiler.target>1.7</maven.compiler.target>

grpclb/build.gradle

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ dependencies {
1414
project(':grpc-stub'),
1515
libraries.protobuf
1616
compile (libraries.protobuf_util) {
17-
// prefer 20.0 from libraries instead of 19.0
18-
exclude group: 'com.google.guava', module: 'guava'
17+
// prefer 2.3.2 from libraries instead of 2.1.3 from guava
18+
exclude group: 'com.google.errorprone', module: 'error_prone_annotations'
19+
// prefer 1.17 from libraries instead of 1.14 from guava
20+
exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations'
1921
}
2022
compileOnly libraries.javax_annotation
2123
testCompile libraries.truth,

protobuf-lite/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ dependencies {
1515
compile project(':grpc-core'),
1616
libraries.protobuf_lite
1717
compile (libraries.guava) {
18-
// prefer 2.2.0 from libraries instead of 2.1.3
18+
// prefer 2.3.2 from libraries instead of 2.1.3
1919
exclude group: 'com.google.errorprone', module: 'error_prone_annotations'
2020
// prefer 3.0.2 from libraries instead of 3.0.1
2121
exclude group: 'com.google.code.findbugs', module: 'jsr305'

protobuf-nano/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dependencies {
1313
compile project(':grpc-core'),
1414
libraries.protobuf_nano
1515
compile (libraries.guava) {
16-
// prefer 2.2.0 from libraries instead of 2.1.3
16+
// prefer 2.3.2 from libraries instead of 2.1.3
1717
exclude group: 'com.google.errorprone', module: 'error_prone_annotations'
1818
// prefer 3.0.2 from libraries instead of 3.0.1
1919
exclude group: 'com.google.code.findbugs', module: 'jsr305'

protobuf/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dependencies {
1212
compile project(':grpc-core'),
1313
libraries.protobuf
1414
compile (libraries.guava) {
15-
// prefer 2.2.0 from libraries instead of 2.1.3
15+
// prefer 2.3.2 from libraries instead of 2.1.3
1616
exclude group: 'com.google.errorprone', module: 'error_prone_annotations'
1717
// prefer 3.0.2 from libraries instead of 3.0.1
1818
exclude group: 'com.google.code.findbugs', module: 'jsr305'

repositories.bzl

+37-5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
44
load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external")
55

66
def grpc_java_repositories(
7+
omit_bazel_skylib = False,
78
omit_com_google_android_annotations = False,
89
omit_com_google_api_grpc_google_common_protos = False,
910
omit_com_google_auth_google_auth_library_credentials = False,
@@ -37,9 +38,12 @@ def grpc_java_repositories(
3738
omit_io_opencensus_grpc_metrics = False,
3839
omit_javax_annotation = False,
3940
omit_junit_junit = False,
41+
omit_net_zlib = False,
4042
omit_org_apache_commons_lang3 = False,
4143
omit_org_codehaus_mojo_animal_sniffer_annotations = False):
4244
"""Imports dependencies for grpc-java."""
45+
if not omit_bazel_skylib:
46+
bazel_skylib()
4347
if not omit_com_google_android_annotations:
4448
com_google_android_annotations()
4549
if not omit_com_google_api_grpc_google_common_protos:
@@ -106,6 +110,8 @@ def grpc_java_repositories(
106110
javax_annotation()
107111
if not omit_junit_junit:
108112
junit_junit()
113+
if not omit_net_zlib:
114+
net_zlib()
109115
if not omit_org_apache_commons_lang3:
110116
org_apache_commons_lang3()
111117
if not omit_org_codehaus_mojo_animal_sniffer_annotations:
@@ -119,6 +125,22 @@ def grpc_java_repositories(
119125
name = "gson",
120126
actual = "@com_google_code_gson_gson//jar",
121127
)
128+
native.bind(
129+
name = "zlib",
130+
actual = "@net_zlib//:zlib",
131+
)
132+
native.bind(
133+
name = "error_prone_annotations",
134+
actual = "@com_google_errorprone_error_prone_annotations//jar",
135+
)
136+
137+
def bazel_skylib():
138+
http_archive(
139+
name = "bazel_skylib",
140+
sha256 = "bce240a0749dfc52fab20dce400b4d5cf7c28b239d64f8fd1762b3c9470121d8",
141+
strip_prefix = "bazel-skylib-0.7.0",
142+
urls = ["https://github.com/bazelbuild/bazel-skylib/archive/0.7.0.zip"],
143+
)
122144

123145
def com_google_android_annotations():
124146
jvm_maven_import_external(
@@ -177,9 +199,9 @@ def com_google_code_gson():
177199
def com_google_errorprone_error_prone_annotations():
178200
jvm_maven_import_external(
179201
name = "com_google_errorprone_error_prone_annotations",
180-
artifact = "com.google.errorprone:error_prone_annotations:2.2.0",
202+
artifact = "com.google.errorprone:error_prone_annotations:2.3.2",
181203
server_urls = ["http://central.maven.org/maven2"],
182-
artifact_sha256 = "6ebd22ca1b9d8ec06d41de8d64e0596981d9607b42035f9ed374f9de271a481a",
204+
artifact_sha256 = "357cd6cfb067c969226c442451502aee13800a24e950fdfde77bcdb4565a668d",
183205
licenses = ["notice"], # Apache 2.0
184206
)
185207

@@ -217,9 +239,10 @@ def com_google_protobuf():
217239
# This statement defines the @com_google_protobuf repo.
218240
http_archive(
219241
name = "com_google_protobuf",
220-
sha256 = "d6618d117698132dadf0f830b762315807dc424ba36ab9183f1f436008a2fdb6",
221-
strip_prefix = "protobuf-3.6.1.2",
222-
urls = ["https://github.com/google/protobuf/archive/v3.6.1.2.zip"],
242+
sha256 = "8955eb28f9c6db71d013bfe8255e485837d473db8a5786f6a017e40934f304a7",
243+
strip_prefix = "protobuf-4b9a5df4e8ba2066794da56598ad2905dc42051e",
244+
# This is v3.7.0 with a Bazel compilation failure fix
245+
urls = ["https://github.com/google/protobuf/archive/4b9a5df4e8ba2066794da56598ad2905dc42051e.zip"],
223246
)
224247

225248
def com_google_protobuf_javalite():
@@ -412,6 +435,15 @@ def junit_junit():
412435
licenses = ["notice"], # EPL 1.0
413436
)
414437

438+
def net_zlib():
439+
http_archive(
440+
name = "net_zlib",
441+
build_file = "@com_google_protobuf//:third_party/zlib.BUILD",
442+
sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",
443+
strip_prefix = "zlib-1.2.11",
444+
urls = ["https://zlib.net/zlib-1.2.11.tar.gz"],
445+
)
446+
415447
def org_apache_commons_lang3():
416448
jvm_maven_import_external(
417449
name = "org_apache_commons_commons_lang3",

services/build.gradle

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ dependencies {
2121
compile project(':grpc-protobuf'),
2222
project(':grpc-stub')
2323
compile (libraries.protobuf_util) {
24-
// prefer 20.0 from libraries instead of 19.0
25-
exclude group: 'com.google.guava', module: 'guava'
24+
// prefer 2.3.2 from libraries instead of 2.1.3 from guava
25+
exclude group: 'com.google.errorprone', module: 'error_prone_annotations'
26+
// prefer 1.17 from libraries instead of 1.14 from guava
27+
exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations'
2628
}
2729
compile libraries.re2j
2830

xds/build.gradle

+4-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ dependencies {
2626
compile project(':grpc-protobuf'),
2727
project(':grpc-stub')
2828
compile (libraries.protobuf_util) {
29-
// prefer 20.0 from libraries instead of 19.0
30-
exclude group: 'com.google.guava', module: 'guava'
29+
// prefer 2.3.2 from libraries instead of 2.1.3 from guava
30+
exclude group: 'com.google.errorprone', module: 'error_prone_annotations'
31+
// prefer 1.17 from libraries instead of 1.14 from guava
32+
exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations'
3133
}
3234

3335
testCompile project(':grpc-core').sourceSets.test.output

0 commit comments

Comments
 (0)