Skip to content

Commit 8d10eca

Browse files
committed
Merge branch 'master' into HEAD
Turned back off compat repositories to swapping new targets to artifact() in a less-noisy commit. Conflicts: BUILD.bazel WORKSPACE api/BUILD.bazel core/BUILD.bazel netty/BUILD.bazel okhttp/BUILD.bazel services/BUILD.bazel testing/BUILD.bazel xds/BUILD.bazel
2 parents 579c97a + 2c83ef0 commit 8d10eca

File tree

1,119 files changed

+54337
-33834
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,119 files changed

+54337
-33834
lines changed

.bazelrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build --cxxopt=-std=c++14 --host_cxxopt=-std=c++14

.github/workflows/gradle-wrapper-validation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ jobs:
99
name: "Gradle wrapper validation"
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v3
1313
- uses: gradle/wrapper-validation-action@v1

.github/workflows/lock.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313
lock:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: dessant/lock-threads@v2
16+
- uses: dessant/lock-threads@v4
1717
with:
1818
github-token: ${{ github.token }}
19-
issue-lock-inactive-days: 90
20-
pr-lock-inactive-days: 90
19+
issue-inactive-days: 90
20+
pr-inactive-days: 90

.github/workflows/testing.yml

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ jobs:
1717
runs-on: ubuntu-latest
1818
strategy:
1919
matrix:
20-
jre: [8, 11]
20+
jre: [8, 11, 17]
2121
fail-fast: false # Should swap to true if we grow a large matrix
2222

2323
steps:
24-
- uses: actions/checkout@v2
25-
- uses: actions/setup-java@v2
24+
- uses: actions/checkout@v3
25+
- uses: actions/setup-java@v3
2626
with:
2727
java-version: ${{ matrix.jre }}
2828
distribution: 'temurin'
2929

3030
- name: Gradle cache
31-
uses: actions/cache@v2
31+
uses: actions/cache@v3
3232
with:
3333
path: |
3434
~/.gradle/caches
@@ -37,7 +37,7 @@ jobs:
3737
restore-keys: |
3838
${{ runner.os }}-gradle-
3939
- name: Maven cache
40-
uses: actions/cache@v2
40+
uses: actions/cache@v3
4141
with:
4242
path: |
4343
~/.m2/repository
@@ -46,7 +46,7 @@ jobs:
4646
restore-keys: |
4747
${{ runner.os }}-maven-
4848
- name: Protobuf cache
49-
uses: actions/cache@v2
49+
uses: actions/cache@v3
5050
with:
5151
path: /tmp/protobuf-cache
5252
key: ${{ runner.os }}-maven-${{ hashFiles('buildscripts/make_dependencies.sh') }}
@@ -55,16 +55,39 @@ jobs:
5555
run: buildscripts/kokoro/unix.sh
5656
- name: Post Failure Upload Test Reports to Artifacts
5757
if: ${{ failure() }}
58-
uses: actions/upload-artifact@v2
58+
uses: actions/upload-artifact@v3
5959
with:
6060
name: Test Reports (JRE ${{ matrix.jre }})
61-
path: ./*/build/reports/tests/**
61+
path: |
62+
./*/build/reports/tests/**
63+
./*/*/build/reports/tests/**
6264
retention-days: 14
6365
- name: Check for modified codegen
6466
run: test -z "$(git status --porcelain)" || (git status && echo Error Working directory is not clean. Forget to commit generated files? && false)
6567

6668
- name: Coveralls
6769
if: matrix.jre == 8 # Upload once, instead of for each job in the matrix
68-
run: ./gradlew :grpc-all:coveralls -x compileJava
70+
env:
71+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
72+
run: ./gradlew :grpc-all:coveralls -PskipAndroid=true -x compileJava
6973
- name: Codecov
70-
uses: codecov/codecov-action@v2
74+
uses: codecov/codecov-action@v3
75+
76+
bazel:
77+
runs-on: ubuntu-latest
78+
env:
79+
USE_BAZEL_VERSION: 6.0.0
80+
81+
steps:
82+
- uses: actions/checkout@v3
83+
84+
- name: Bazel cache
85+
uses: actions/cache@v3
86+
with:
87+
path: |
88+
~/.cache/bazel/*/cache
89+
~/.cache/bazelisk/downloads
90+
key: ${{ runner.os }}-bazel-${{ env.USE_BAZEL_VERSION }}-${{ hashFiles('WORKSPACE', 'repositories.bzl') }}
91+
92+
- name: Run bazel build
93+
run: bazelisk build //...

BUILD.bazel

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,8 @@ java_library(
6565
exported_plugins = [":auto_value"],
6666
neverlink = 1,
6767
visibility = ["//:__subpackages__"],
68-
exports = [artifact("com.google.auto.value:auto-value-annotations")],
68+
exports = [
69+
artifact("com.google.auto.value:auto-value-annotations"),
70+
artifact("org.apache.tomcat:annotations-api"), # @Generated for Java 9+
71+
],
6972
)

COMPILING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ This section is only necessary if you are making changes to the code
4444
generation. Most users only need to use `skipCodegen=true` as discussed above.
4545

4646
### Build Protobuf
47-
The codegen plugin is C++ code and requires protobuf 3.21.1 or later.
47+
The codegen plugin is C++ code and requires protobuf 21.7 or later.
4848

4949
For Linux, Mac and MinGW:
5050
```
51-
$ PROTOBUF_VERSION=3.21.1
51+
$ PROTOBUF_VERSION=21.7
5252
$ curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protobuf-all-$PROTOBUF_VERSION.tar.gz
5353
$ tar xzf protobuf-all-$PROTOBUF_VERSION.tar.gz
5454
$ cd protobuf-$PROTOBUF_VERSION
@@ -68,7 +68,7 @@ For Visual C++, please refer to the [Protobuf README](https://github.com/google/
6868
for how to compile Protobuf. gRPC-java assumes a Release build.
6969

7070
#### Mac
71-
Some versions of Mac OS X (e.g., 10.10) doesn't have ``/usr/local`` in the
71+
Some versions of Mac OS X (e.g., 10.10) don't have ``/usr/local`` in the
7272
default search paths for header files and libraries. It will fail the build of
7373
the codegen. To work around this, you will need to set environment variables:
7474
```

CONTRIBUTING.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,6 @@ for reviewers:
5252
Project maintainers are obligated to squash those commits into one when
5353
merging.
5454

55-
## Running tests
56-
57-
### Jetty ALPN setup for IntelliJ
58-
59-
The tests in interop-testing project require jetty-alpn agent running in the background
60-
otherwise they'll fail. Here are instructions on how to setup IntellJ IDEA to enable running
61-
those tests in IDE:
62-
63-
* Settings -> Build Tools -> Gradle -> Runner -> select Gradle Test Runner
64-
* View -> Tool Windows -> Gradle -> Edit Run Configuration -> Defaults -> JUnit -> Before lauch -> + -> Run Gradle task, enter the task in the build.gradle that sets the javaagent.
65-
66-
Step 1 must be taken, otherwise by the default JUnit Test Runner running a single test in IDE will trigger all the tests.
67-
6855
## Guidelines for Pull Requests
6956
How to get your contributions merged smoothly and quickly.
7057

MAINTAINERS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ for general contribution guidelines.
99

1010
## Maintainers (in alphabetical order)
1111
- [ejona86](https://github.com/ejona86), Google LLC
12+
- [jdcormie](https://github.com/jdcormie), Google LLC
1213
- [larry-safran](https://github.com/larry-safran), Google LLC
14+
- [markb74](https://github.com/markb74), Google LLC
1315
- [ran-su](https://github.com/ran-su), Google LLC
1416
- [sanjaypujare](https://github.com/sanjaypujare), Google LLC
1517
- [sergiitk](https://github.com/sergiitk), Google LLC

README.md

Lines changed: 61 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
gRPC-Java - An RPC library and framework
22
========================================
33

4-
gRPC-Java works with JDK 8. gRPC-Java clients are supported on Android API
5-
levels 19 and up (KitKat and later). Deploying gRPC servers on an Android
6-
device is not supported.
7-
8-
TLS usage typically requires using Java 8, or Play Services Dynamic Security
9-
Provider on Android. Please see the [Security Readme](SECURITY.md).
10-
114
<table>
125
<tr>
136
<td><b>Homepage:</b></td>
@@ -20,19 +13,39 @@ Provider on Android. Please see the [Security Readme](SECURITY.md).
2013
</table>
2114

2215
[![Join the chat at https://gitter.im/grpc/grpc](https://badges.gitter.im/grpc/grpc.svg)](https://gitter.im/grpc/grpc?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
23-
[![Build Status](https://travis-ci.org/grpc/grpc-java.svg?branch=master)](https://travis-ci.org/grpc/grpc-java)
16+
[![GitHub Actions Linux Testing](https://github.com/grpc/grpc-java/actions/workflows/testing.yml/badge.svg?branch=master)](https://github.com/grpc/grpc-java/actions/workflows/testing.yml?branch=master)
2417
[![Line Coverage Status](https://coveralls.io/repos/grpc/grpc-java/badge.svg?branch=master&service=github)](https://coveralls.io/github/grpc/grpc-java?branch=master)
2518
[![Branch-adjusted Line Coverage Status](https://codecov.io/gh/grpc/grpc-java/branch/master/graph/badge.svg)](https://codecov.io/gh/grpc/grpc-java)
2619

20+
Supported Platforms
21+
-------------------
22+
23+
gRPC-Java supports Java 8 and later. Android minSdkVersion 21 (Lollipop) and
24+
later are supported with [Java 8 language desugaring][android-java-8].
25+
26+
TLS usage on Android typically requires Play Services Dynamic Security Provider.
27+
Please see the [Security Readme](SECURITY.md).
28+
29+
Older Java versions are not directly supported, but a branch remains available
30+
for fixes and releases. See [gRFC P5 JDK Version Support
31+
Policy][P5-jdk-version-support].
32+
33+
Java version | gRPC Branch
34+
------------ | -----------
35+
7 | 1.41.x
36+
37+
[android-java-8]: https://developer.android.com/studio/write/java8-support#supported_features
38+
[P5-jdk-version-support]: https://github.com/grpc/proposal/blob/master/P5-jdk-version-support.md#proposal
39+
2740
Getting Started
2841
---------------
2942

3043
For a guided tour, take a look at the [quick start
3144
guide](https://grpc.io/docs/languages/java/quickstart) or the more explanatory [gRPC
3245
basics](https://grpc.io/docs/languages/java/basics).
3346

34-
The [examples](https://github.com/grpc/grpc-java/tree/v1.49.0/examples) and the
35-
[Android example](https://github.com/grpc/grpc-java/tree/v1.49.0/examples/android)
47+
The [examples](https://github.com/grpc/grpc-java/tree/v1.62.2/examples) and the
48+
[Android example](https://github.com/grpc/grpc-java/tree/v1.62.2/examples/android)
3649
are standalone projects that showcase the usage of gRPC.
3750

3851
Download
@@ -43,18 +56,18 @@ Download [the JARs][]. Or for Maven with non-Android, add to your `pom.xml`:
4356
<dependency>
4457
<groupId>io.grpc</groupId>
4558
<artifactId>grpc-netty-shaded</artifactId>
46-
<version>1.49.0</version>
59+
<version>1.62.2</version>
4760
<scope>runtime</scope>
4861
</dependency>
4962
<dependency>
5063
<groupId>io.grpc</groupId>
5164
<artifactId>grpc-protobuf</artifactId>
52-
<version>1.49.0</version>
65+
<version>1.62.2</version>
5366
</dependency>
5467
<dependency>
5568
<groupId>io.grpc</groupId>
5669
<artifactId>grpc-stub</artifactId>
57-
<version>1.49.0</version>
70+
<version>1.62.2</version>
5871
</dependency>
5972
<dependency> <!-- necessary for Java 9+ -->
6073
<groupId>org.apache.tomcat</groupId>
@@ -66,23 +79,27 @@ Download [the JARs][]. Or for Maven with non-Android, add to your `pom.xml`:
6679

6780
Or for Gradle with non-Android, add to your dependencies:
6881
```gradle
69-
runtimeOnly 'io.grpc:grpc-netty-shaded:1.49.0'
70-
implementation 'io.grpc:grpc-protobuf:1.49.0'
71-
implementation 'io.grpc:grpc-stub:1.49.0'
82+
runtimeOnly 'io.grpc:grpc-netty-shaded:1.62.2'
83+
implementation 'io.grpc:grpc-protobuf:1.62.2'
84+
implementation 'io.grpc:grpc-stub:1.62.2'
7285
compileOnly 'org.apache.tomcat:annotations-api:6.0.53' // necessary for Java 9+
7386
```
7487

7588
For Android client, use `grpc-okhttp` instead of `grpc-netty-shaded` and
7689
`grpc-protobuf-lite` instead of `grpc-protobuf`:
7790
```gradle
78-
implementation 'io.grpc:grpc-okhttp:1.49.0'
79-
implementation 'io.grpc:grpc-protobuf-lite:1.49.0'
80-
implementation 'io.grpc:grpc-stub:1.49.0'
91+
implementation 'io.grpc:grpc-okhttp:1.62.2'
92+
implementation 'io.grpc:grpc-protobuf-lite:1.62.2'
93+
implementation 'io.grpc:grpc-stub:1.62.2'
8194
compileOnly 'org.apache.tomcat:annotations-api:6.0.53' // necessary for Java 9+
8295
```
8396

97+
For [Bazel](https://bazel.build), you can either
98+
[use Maven](https://github.com/bazelbuild/rules_jvm_external)
99+
(with the GAVs from above), or use `@io_grpc_grpc_java//api` et al (see below).
100+
84101
[the JARs]:
85-
https://search.maven.org/search?q=g:io.grpc%20AND%20v:1.49.0
102+
https://search.maven.org/search?q=g:io.grpc%20AND%20v:1.62.2
86103

87104
Development snapshots are available in [Sonatypes's snapshot
88105
repository](https://oss.sonatype.org/content/repositories/snapshots/).
@@ -103,7 +120,7 @@ For protobuf-based codegen integrated with the Maven build system, you can use
103120
<extension>
104121
<groupId>kr.motd.maven</groupId>
105122
<artifactId>os-maven-plugin</artifactId>
106-
<version>1.6.2</version>
123+
<version>1.7.1</version>
107124
</extension>
108125
</extensions>
109126
<plugins>
@@ -112,9 +129,9 @@ For protobuf-based codegen integrated with the Maven build system, you can use
112129
<artifactId>protobuf-maven-plugin</artifactId>
113130
<version>0.6.1</version>
114131
<configuration>
115-
<protocArtifact>com.google.protobuf:protoc:3.21.1:exe:${os.detected.classifier}</protocArtifact>
132+
<protocArtifact>com.google.protobuf:protoc:3.25.1:exe:${os.detected.classifier}</protocArtifact>
116133
<pluginId>grpc-java</pluginId>
117-
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.49.0:exe:${os.detected.classifier}</pluginArtifact>
134+
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.62.2:exe:${os.detected.classifier}</pluginArtifact>
118135
</configuration>
119136
<executions>
120137
<execution>
@@ -135,16 +152,16 @@ For non-Android protobuf-based codegen integrated with the Gradle build system,
135152
you can use [protobuf-gradle-plugin][]:
136153
```gradle
137154
plugins {
138-
id 'com.google.protobuf' version '0.8.18'
155+
id 'com.google.protobuf' version '0.9.4'
139156
}
140157
141158
protobuf {
142159
protoc {
143-
artifact = "com.google.protobuf:protoc:3.21.1"
160+
artifact = "com.google.protobuf:protoc:3.25.1"
144161
}
145162
plugins {
146163
grpc {
147-
artifact = 'io.grpc:protoc-gen-grpc-java:1.49.0'
164+
artifact = 'io.grpc:protoc-gen-grpc-java:1.62.2'
148165
}
149166
}
150167
generateProtoTasks {
@@ -168,16 +185,16 @@ use protobuf-gradle-plugin but specify the 'lite' options:
168185

169186
```gradle
170187
plugins {
171-
id 'com.google.protobuf' version '0.8.18'
188+
id 'com.google.protobuf' version '0.9.4'
172189
}
173190
174191
protobuf {
175192
protoc {
176-
artifact = "com.google.protobuf:protoc:3.21.1"
193+
artifact = "com.google.protobuf:protoc:3.25.1"
177194
}
178195
plugins {
179196
grpc {
180-
artifact = 'io.grpc:protoc-gen-grpc-java:1.49.0'
197+
artifact = 'io.grpc:protoc-gen-grpc-java:1.62.2'
181198
}
182199
}
183200
generateProtoTasks {
@@ -194,6 +211,11 @@ protobuf {
194211
195212
```
196213

214+
For [Bazel](https://bazel.build), use the [`proto_library`](https://github.com/bazelbuild/rules_proto)
215+
and the [`java_proto_library`](https://bazel.build/reference/be/java#java_proto_library) (no `load()` required)
216+
and `load("@io_grpc_grpc_java//:java_grpc_library.bzl", "java_grpc_library")` (from this project), as in
217+
[this example `BUILD.bazel`](https://github.com/grpc/grpc-java/blob/master/examples/BUILD.bazel).
218+
197219
API Stability
198220
-------------
199221

@@ -243,12 +265,15 @@ wire. The interfaces to it are abstract just enough to allow plugging in of
243265
different implementations. Note the transport layer API is considered internal
244266
to gRPC and has weaker API guarantees than the core API under package `io.grpc`.
245267

246-
gRPC comes with three Transport implementations:
268+
gRPC comes with multiple Transport implementations:
247269

248-
1. The Netty-based transport is the main transport implementation based on
249-
[Netty](https://netty.io). It is for both the client and the server.
250-
2. The OkHttp-based transport is a lightweight transport based on
251-
[OkHttp](https://square.github.io/okhttp/). It is mainly for use on Android
252-
and is for client only.
270+
1. The Netty-based HTTP/2 transport is the main transport implementation based
271+
on [Netty](https://netty.io). It is not officially supported on Android.
272+
2. The OkHttp-based HTTP/2 transport is a lightweight transport based on
273+
[Okio](https://square.github.io/okio/) and forked low-level parts of
274+
[OkHttp](https://square.github.io/okhttp/). It is mainly for use on Android.
253275
3. The in-process transport is for when a server is in the same process as the
254-
client. It is useful for testing, while also being safe for production use.
276+
client. It is used frequently for testing, while also being safe for
277+
production use.
278+
4. The Binder transport is for Android cross-process communication on a single
279+
device.

0 commit comments

Comments
 (0)