2 # Copyright 2018 gRPC authors.
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
8 # http://www.apache.org/licenses/LICENSE-2.0
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.
18 # Accept the Android SDK licences.
19 yes | /opt/android-sdk/current/tools/bin/sdkmanager --licenses
21 # change to grpc repo root
22 cd $(dirname $0)/../../..
26 git submodule update --init
28 # Build protoc and grpc_cpp_plugin. Codegen is not cross-compiled to Android
31 cmake -DgRPC_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release ../..
32 make protoc grpc_cpp_plugin -j2
35 PROTOC=${REPO_ROOT}/cmake/build/third_party/protobuf/protoc
36 PLUGIN=${REPO_ROOT}/cmake/build/grpc_cpp_plugin
38 # Build and run interop instrumentation tests on Firebase Test Lab
40 cd "${REPO_ROOT}/src/android/test/interop/"
41 ./gradlew assembleDebug \
42 "-Pprotoc=${PROTOC}" \
43 "-Pgrpc_cpp_plugin=${PLUGIN}"
44 ./gradlew assembleDebugAndroidTest \
45 "-Pprotoc=${PROTOC}" \
46 "-Pgrpc_cpp_plugin=${PLUGIN}"
47 gcloud firebase test android run \
48 --type instrumentation \
49 --app app/build/outputs/apk/debug/app-debug.apk \
50 --test app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk \
51 --device model=Nexus6P,version=27,locale=en,orientation=portrait \
52 --device model=Nexus6P,version=26,locale=en,orientation=portrait \
53 --device model=Nexus6P,version=25,locale=en,orientation=portrait \
54 --device model=Nexus6P,version=24,locale=en,orientation=portrait \
55 --device model=Nexus6P,version=23,locale=en,orientation=portrait \
56 --device model=Nexus6,version=22,locale=en,orientation=portrait \
57 --device model=Nexus6,version=21,locale=en,orientation=portrait \
58 --device model=walleye,version=28,locale=en,orientation=portrait
61 # Build hello world example
63 cd "${REPO_ROOT}/examples/android/helloworld"
65 "-Pprotoc=${PROTOC}" \
66 "-Pgrpc_cpp_plugin=${PLUGIN}"