playwright/utils/build_android_driver.sh
Max Schmitt c6aab05bd5
devops: make Android driver compile (#31360)
Fixes https://github.com/microsoft/playwright/issues/31355

All changes were done with the Android Studio upgrade assistant. It
updates it to the latest Gradle to make it compatible with recent Java
while keeping the `targetSdkVersion` unchanged.
2024-06-18 18:23:29 +02:00

23 lines
735 B
Bash
Executable File

#!/usr/bin/env bash
(cd packages/playwright-core/src/server/android/driver ; ./gradlew assemble)
if [ "$?" -ne "0" ]; then
exit 1
fi
(cd packages/playwright-core/src/server/android/driver ; ./gradlew assembleAndroidTest)
if [ "$?" -ne "0" ]; then
exit 1
fi
# These should be uploaded to the CDN
mkdir -p for-cdn
cp packages/playwright-core/src/server/android/driver/app/build/outputs/apk/debug/app-debug.apk ./for-cdn/android-driver-target.apk
cp packages/playwright-core/src/server/android/driver/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk ./for-cdn/android-driver.apk
cd for-cdn
zip /tmp/android.zip *.apk
cd ..
rm -r for-cdn
echo "Android driver APKs are in /tmp/android.zip. Upload them to the CDN."