Skip to content

Commit

Permalink
kokoro: Adjust android CIs to work with Ubuntu 22.04 image
Browse files Browse the repository at this point in the history
It doesn't have Android SDK nor the VERSION file. See also d654707
  • Loading branch information
ejona86 committed Jul 8, 2024
1 parent 0454b9e commit 3dbc86e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
12 changes: 8 additions & 4 deletions buildscripts/kokoro/android-interop.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#!/bin/bash

set -exu -o pipefail
if [[ -f /VERSION ]]; then
cat /VERSION
fi

# Install gRPC and codegen for the Android interop app
# (a composite gradle build can't find protoc-gen-grpc-java)
Expand All @@ -16,7 +13,14 @@ export CXXFLAGS=-I/tmp/protobuf/include
export LD_LIBRARY_PATH=/tmp/protobuf/lib
export OS_NAME=$(uname)

(yes || true) | "${ANDROID_HOME}/tools/bin/sdkmanager" --licenses
export ANDROID_HOME=/tmp/Android/Sdk
mkdir -p "${ANDROID_HOME}/cmdline-tools"
curl -Ls -o cmdline.zip \
"https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip"
unzip -qd "${ANDROID_HOME}/cmdline-tools" cmdline.zip
rm cmdline.zip
mv "${ANDROID_HOME}/cmdline-tools/cmdline-tools" "${ANDROID_HOME}/cmdline-tools/latest"
(yes || true) | "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" --licenses

# Proto deps
buildscripts/make_dependencies.sh
Expand Down
10 changes: 8 additions & 2 deletions buildscripts/kokoro/android.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

set -exu -o pipefail
cat /VERSION

BASE_DIR="$(pwd)"

Expand All @@ -23,7 +22,14 @@ cat <<EOF >> gradle.properties
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=1024m
EOF

(yes || true) | "${ANDROID_HOME}/tools/bin/sdkmanager" --licenses
export ANDROID_HOME=/tmp/Android/Sdk
mkdir -p "${ANDROID_HOME}/cmdline-tools"
curl -Ls -o cmdline.zip \
"https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip"
unzip -qd "${ANDROID_HOME}/cmdline-tools" cmdline.zip
rm cmdline.zip
mv "${ANDROID_HOME}/cmdline-tools/cmdline-tools" "${ANDROID_HOME}/cmdline-tools/latest"
(yes || true) | "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" --licenses

# Proto deps
buildscripts/make_dependencies.sh
Expand Down

0 comments on commit 3dbc86e

Please sign in to comment.