cronet: use Cronet from Google's Maven repository (#4531)

This commit is contained in:
Eric Gribkoff 2018-06-04 20:16:02 -07:00 committed by GitHub
parent 6dbe3921ed
commit 8fd762fb8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 22 deletions

View File

@ -25,7 +25,6 @@ buildscripts/make_dependencies.sh
# Build grpc-cronet
pushd cronet
./cronet_deps.sh
../gradlew build
popd

View File

@ -3,8 +3,7 @@ gRPC Cronet Transport
**EXPERIMENTAL:** *gRPC's Cronet transport is an experimental API, and is not
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
Android application.*
integrating the gRPC code in this directory into your Android application.*
This code enables using the [Chromium networking stack
(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
* Support for [QUIC](https://www.chromium.org/quic)
Cronet jars are not currently available on Maven. The instructions at
https://github.com/GoogleChrome/cronet-sample/blob/master/README.md describe
how to manually download the Cronet binaries and add them to your Android
application. You will also need to copy the gRPC source files contained in this
Cronet jars are available on Google's Maven repository. See the example app at
https://github.com/GoogleChrome/cronet-sample/blob/master/README.md. To use
Cronet with gRPC, you will need to copy the gRPC source files contained in this
directory into your application's code, as we do not currently provide a
`grpc-cronet` dependency.
@ -45,10 +43,3 @@ ExperimentalCronetEngine engine =
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.

View File

@ -51,8 +51,7 @@ dependencies {
implementation 'io.grpc:grpc-core: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 files('libs/cronet_impl_common_java.jar')
implementation "org.chromium.net:cronet-embedded:66.3359.158"
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:1.10.19'

View File

@ -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/