Eric Gribkoff | 2d9e7f9 | 2018-03-22 13:11:04 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | # Copyright 2018 gRPC authors. |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | set -ex |
| 17 | |
| 18 | # change to grpc repo root |
| 19 | cd $(dirname $0)/../../.. |
| 20 | |
Eric Gribkoff | 18e954d | 2018-03-26 11:14:52 -0700 | [diff] [blame] | 21 | REPO_ROOT="$(pwd)" |
| 22 | |
Eric Gribkoff | 2d9e7f9 | 2018-03-22 13:11:04 -0700 | [diff] [blame] | 23 | git submodule update --init |
| 24 | |
Eric Gribkoff | f54e4a3 | 2018-03-23 17:01:52 -0700 | [diff] [blame] | 25 | # Build protoc and grpc_cpp_plugin. Codegen is not cross-compiled to Android |
| 26 | make HAS_SYSTEM_PROTOBUF=false |
| 27 | |
Eric Gribkoff | 2d9e7f9 | 2018-03-22 13:11:04 -0700 | [diff] [blame] | 28 | # TODO(ericgribkoff) Remove when this commit (already in master) is included in |
| 29 | # next protobuf release |
| 30 | cd third_party/protobuf |
Eric Gribkoff | 6ee3e6d | 2018-03-22 15:47:18 -0700 | [diff] [blame] | 31 | git fetch |
Eric Gribkoff | 2d9e7f9 | 2018-03-22 13:11:04 -0700 | [diff] [blame] | 32 | git cherry-pick 7daa320065f3bea2b54bf983337d1724f153422d -m 1 |
| 33 | |
Eric Gribkoff | 6f6b83e | 2018-04-06 10:44:28 -0700 | [diff] [blame^] | 34 | |
| 35 | # Build and run interop instrumentation tests on Firebase Test Lab |
| 36 | |
| 37 | cd "${REPO_ROOT}/src/android/test/interop/" |
| 38 | ./gradlew assembleDebug \ |
| 39 | "-Pprotoc=${REPO_ROOT}/third_party/protobuf/src/protoc" \ |
| 40 | "-Pgrpc_cpp_plugin=${REPO_ROOT}/bins/opt/grpc_cpp_plugin" |
| 41 | ./gradlew assembleDebugAndroidTest \ |
| 42 | "-Pprotoc=${REPO_ROOT}/third_party/protobuf/src/protoc" \ |
| 43 | "-Pgrpc_cpp_plugin=${REPO_ROOT}/bins/opt/grpc_cpp_plugin" |
| 44 | gcloud firebase test android run \ |
| 45 | --type instrumentation \ |
| 46 | --app app/build/outputs/apk/debug/app-debug.apk \ |
| 47 | --test app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk \ |
| 48 | --device model=Nexus6P,version=27,locale=en,orientation=portrait \ |
| 49 | --device model=Nexus6P,version=26,locale=en,orientation=portrait \ |
| 50 | --device model=Nexus6P,version=25,locale=en,orientation=portrait \ |
| 51 | --device model=Nexus6P,version=24,locale=en,orientation=portrait \ |
| 52 | --device model=Nexus6P,version=23,locale=en,orientation=portrait \ |
| 53 | --device model=Nexus6,version=22,locale=en,orientation=portrait \ |
| 54 | --device model=Nexus6,version=21,locale=en,orientation=portrait |
| 55 | |
| 56 | |
| 57 | # Build hello world example |
| 58 | |
| 59 | cd "${REPO_ROOT}/examples/android/helloworld" |
Eric Gribkoff | f54e4a3 | 2018-03-23 17:01:52 -0700 | [diff] [blame] | 60 | ./gradlew build \ |
Eric Gribkoff | 18e954d | 2018-03-26 11:14:52 -0700 | [diff] [blame] | 61 | "-Pprotoc=${REPO_ROOT}/third_party/protobuf/src/protoc" \ |
| 62 | "-Pgrpc_cpp_plugin=${REPO_ROOT}/bins/opt/grpc_cpp_plugin" |