blob: 2220145dacc5509d0b56f97fe24a934647122ef5 [file] [log] [blame]
Eric Gribkoff2d9e7f92018-03-22 13:11:04 -07001#!/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
16set -ex
17
18# change to grpc repo root
19cd $(dirname $0)/../../..
20
Eric Gribkoff18e954d2018-03-26 11:14:52 -070021REPO_ROOT="$(pwd)"
22
Eric Gribkoff2d9e7f92018-03-22 13:11:04 -070023git submodule update --init
24
Eric Gribkofff54e4a32018-03-23 17:01:52 -070025# Build protoc and grpc_cpp_plugin. Codegen is not cross-compiled to Android
26make HAS_SYSTEM_PROTOBUF=false
27
Eric Gribkoff2d9e7f92018-03-22 13:11:04 -070028# TODO(ericgribkoff) Remove when this commit (already in master) is included in
29# next protobuf release
30cd third_party/protobuf
Eric Gribkoff6ee3e6d2018-03-22 15:47:18 -070031git fetch
Eric Gribkoff2d9e7f92018-03-22 13:11:04 -070032git cherry-pick 7daa320065f3bea2b54bf983337d1724f153422d -m 1
33
Eric Gribkoff6f6b83e2018-04-06 10:44:28 -070034
35# Build and run interop instrumentation tests on Firebase Test Lab
36
37cd "${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"
44gcloud 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
59cd "${REPO_ROOT}/examples/android/helloworld"
Eric Gribkofff54e4a32018-03-23 17:01:52 -070060./gradlew build \
Eric Gribkoff18e954d2018-03-26 11:14:52 -070061 "-Pprotoc=${REPO_ROOT}/third_party/protobuf/src/protoc" \
62 "-Pgrpc_cpp_plugin=${REPO_ROOT}/bins/opt/grpc_cpp_plugin"