diff --git a/tools/internal_ci/linux/grpc_android.sh b/tools/internal_ci/linux/grpc_android.sh index 87c7a24dd7f..e0bee1cb14f 100755 --- a/tools/internal_ci/linux/grpc_android.sh +++ b/tools/internal_ci/linux/grpc_android.sh @@ -15,10 +15,6 @@ set -ex -# Install packages which were not preinstalled yet. -# Protobuf needs autoconf & automake to build -sudo apt-get install -y autoconf automake - # Accept the Android SDK licences. yes | /opt/android-sdk/current/tools/bin/sdkmanager --licenses @@ -30,17 +26,24 @@ REPO_ROOT="$(pwd)" git submodule update --init # Build protoc and grpc_cpp_plugin. Codegen is not cross-compiled to Android -make HAS_SYSTEM_PROTOBUF=false +mkdir -p cmake/build +pushd cmake/build +cmake -DgRPC_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release ../.. +make protoc grpc_cpp_plugin -j2 +popd + +PROTOC=${REPO_ROOT}/cmake/build/third_party/protobuf/protoc +PLUGIN=${REPO_ROOT}/cmake/build/grpc_cpp_plugin # Build and run interop instrumentation tests on Firebase Test Lab cd "${REPO_ROOT}/src/android/test/interop/" ./gradlew assembleDebug \ - "-Pprotoc=${REPO_ROOT}/third_party/protobuf/src/protoc" \ - "-Pgrpc_cpp_plugin=${REPO_ROOT}/bins/opt/grpc_cpp_plugin" + "-Pprotoc=${PROTOC}" \ + "-Pgrpc_cpp_plugin=${PLUGIN}" ./gradlew assembleDebugAndroidTest \ - "-Pprotoc=${REPO_ROOT}/third_party/protobuf/src/protoc" \ - "-Pgrpc_cpp_plugin=${REPO_ROOT}/bins/opt/grpc_cpp_plugin" + "-Pprotoc=${PROTOC}" \ + "-Pgrpc_cpp_plugin=${PLUGIN}" gcloud firebase test android run \ --type instrumentation \ --app app/build/outputs/apk/debug/app-debug.apk \ @@ -59,5 +62,5 @@ gcloud firebase test android run \ cd "${REPO_ROOT}/examples/android/helloworld" ./gradlew build \ - "-Pprotoc=${REPO_ROOT}/third_party/protobuf/src/protoc" \ - "-Pgrpc_cpp_plugin=${REPO_ROOT}/bins/opt/grpc_cpp_plugin" + "-Pprotoc=${PROTOC}" \ + "-Pgrpc_cpp_plugin=${PLUGIN}"