mirror of https://github.com/grpc/grpc-java.git
cronet: use Cronet from Google's Maven repository (#4531)
This commit is contained in:
parent
6dbe3921ed
commit
8fd762fb8e
|
|
@ -25,7 +25,6 @@ buildscripts/make_dependencies.sh
|
||||||
# Build grpc-cronet
|
# Build grpc-cronet
|
||||||
|
|
||||||
pushd cronet
|
pushd cronet
|
||||||
./cronet_deps.sh
|
|
||||||
../gradlew build
|
../gradlew build
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,7 @@ gRPC Cronet Transport
|
||||||
|
|
||||||
**EXPERIMENTAL:** *gRPC's Cronet transport is an experimental API, and is not
|
**EXPERIMENTAL:** *gRPC's Cronet transport is an experimental API, and is not
|
||||||
yet integrated with our build system. Using Cronet with gRPC requires manually
|
yet integrated with our build system. Using Cronet with gRPC requires manually
|
||||||
integrating the Cronet libraries and the gRPC code in this directory into your
|
integrating the gRPC code in this directory into your Android application.*
|
||||||
Android application.*
|
|
||||||
|
|
||||||
This code enables using the [Chromium networking stack
|
This code enables using the [Chromium networking stack
|
||||||
(Cronet)](https://chromium.googlesource.com/chromium/src/+/master/components/cronet)
|
(Cronet)](https://chromium.googlesource.com/chromium/src/+/master/components/cronet)
|
||||||
|
|
@ -17,10 +16,9 @@ Some advantages of using Cronet with gRPC:
|
||||||
* Robust to Android network connectivity changes
|
* Robust to Android network connectivity changes
|
||||||
* Support for [QUIC](https://www.chromium.org/quic)
|
* Support for [QUIC](https://www.chromium.org/quic)
|
||||||
|
|
||||||
Cronet jars are not currently available on Maven. The instructions at
|
Cronet jars are available on Google's Maven repository. See the example app at
|
||||||
https://github.com/GoogleChrome/cronet-sample/blob/master/README.md describe
|
https://github.com/GoogleChrome/cronet-sample/blob/master/README.md. To use
|
||||||
how to manually download the Cronet binaries and add them to your Android
|
Cronet with gRPC, you will need to copy the gRPC source files contained in this
|
||||||
application. You will also need to copy the gRPC source files contained in this
|
|
||||||
directory into your application's code, as we do not currently provide a
|
directory into your application's code, as we do not currently provide a
|
||||||
`grpc-cronet` dependency.
|
`grpc-cronet` dependency.
|
||||||
|
|
||||||
|
|
@ -45,10 +43,3 @@ ExperimentalCronetEngine engine =
|
||||||
ManagedChannel channel = CronetChannelBuilder.forAddress("localhost", 8080, engine).build();
|
ManagedChannel channel = CronetChannelBuilder.forAddress("localhost", 8080, engine).build();
|
||||||
```
|
```
|
||||||
|
|
||||||
## Running the tests with Gradle
|
|
||||||
|
|
||||||
To run the gRPC Cronet tests with the included `gradle.build` file, you will
|
|
||||||
need to first download the Cronet jars and place them in the `libs/` directory.
|
|
||||||
The included script, `cronet_deps.sh`, will do this automatically but requires
|
|
||||||
the [gsutil](https://cloud.google.com/storage/docs/gsutil) tool to access files
|
|
||||||
from Google Cloud Storage.
|
|
||||||
|
|
|
||||||
|
|
@ -51,8 +51,7 @@ dependencies {
|
||||||
implementation 'io.grpc:grpc-core:1.14.0-SNAPSHOT' // CURRENT_GRPC_VERSION
|
implementation 'io.grpc:grpc-core:1.14.0-SNAPSHOT' // CURRENT_GRPC_VERSION
|
||||||
testImplementation 'io.grpc:grpc-testing:1.14.0-SNAPSHOT' // CURRENT_GRPC_VERSION
|
testImplementation 'io.grpc:grpc-testing:1.14.0-SNAPSHOT' // CURRENT_GRPC_VERSION
|
||||||
|
|
||||||
implementation files('libs/cronet_api.jar')
|
implementation "org.chromium.net:cronet-embedded:66.3359.158"
|
||||||
implementation files('libs/cronet_impl_common_java.jar')
|
|
||||||
|
|
||||||
testImplementation 'junit:junit:4.12'
|
testImplementation 'junit:junit:4.12'
|
||||||
testImplementation 'org.mockito:mockito-core:1.10.19'
|
testImplementation 'org.mockito:mockito-core:1.10.19'
|
||||||
|
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
mkdir libs
|
|
||||||
gsutil cp gs://chromium-cronet/android/67.0.3368.0/Release/cronet/cronet_api.jar libs/
|
|
||||||
gsutil cp gs://chromium-cronet/android/67.0.3368.0/Release/cronet/cronet_impl_common_java.jar \
|
|
||||||
libs/
|
|
||||||
Loading…
Reference in New Issue