Skip to content

Commit e910952

Browse files
committed
Fix location of Swift SDK for Android
1 parent 6cab1f3 commit e910952

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

.github/workflows/scripts/android/android-emulator-tests.sh

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,31 +144,32 @@ log "Prepare Swift test package"
144144

145145
# create a staging folder where we copy the test executable
146146
# and all the dependent libraries to copy over to the emulator
147-
STAGING="swift-android-test"
148-
rm -rf .build/"${STAGING}"
149-
mkdir .build/"${STAGING}"
147+
STAGING_DIR="swift-android-test"
148+
rm -rf .build/"${STAGING_DIR}"
149+
mkdir .build/"${STAGING_DIR}"
150150

151151
# for the common case of tests referencing
152152
# their own files as hardwired resource paths
153153
if [[ -d Tests ]]; then
154-
cp -a Tests .build/"${STAGING}"
154+
cp -a Tests .build/"${STAGING_DIR}"
155155
fi
156156

157157
cd .build/
158158
TEST_PACKAGE=$(find debug/ -name '*.xctest' | tail -n 1 | xargs basename)
159-
cp -a debug/"${TEST_PACKAGE}" "${STAGING}"
160-
find debug/ -name '*.resources' -exec cp -a {} "${STAGING}" \;
161-
cp -a "${SWIFT_ANDROID_SDK_HOME}"/swift-android/swift-resources/usr/lib/swift-"${ANDROID_EMULATOR_ARCH_TRIPLE}"/android/*.so "${STAGING}"
162-
cp -a "${ANDROID_NDK_HOME}"/toolchains/llvm/prebuilt/*/sysroot/usr/lib/"${ANDROID_EMULATOR_ARCH_TRIPLE}"-linux-android/libc++_shared.so "${STAGING}"
159+
cp -a debug/"${TEST_PACKAGE}" "${STAGING_DIR}"
160+
find debug/ -name '*.resources' -exec cp -a {} "${STAGING_DIR}" \;
161+
cp -a "${SWIFT_ANDROID_SDK_HOME}"/swift-android/swift-resources/usr/lib/swift-"${ANDROID_EMULATOR_ARCH_TRIPLE}"/android/*.so "${STAGING_DIR}"
162+
cp -a "${ANDROID_NDK_HOME}"/toolchains/llvm/prebuilt/*/sysroot/usr/lib/"${ANDROID_EMULATOR_ARCH_TRIPLE}"-linux-android/libc++_shared.so "${STAGING_DIR}"
163163

164164
log "Copy Swift test package to emulator"
165165

166-
adb push "${STAGING}" /data/local/tmp/
166+
ANDROID_TMP_FOLDER="/data/local/tmp"
167+
adb push "${STAGING_DIR}" "${ANDROID_TMP_FOLDER}"
167168

168169
cd -
169170

170171
TEST_CMD="./${TEST_PACKAGE}"
171-
TEST_SHELL="cd /data/local/tmp/${STAGING}"
172+
TEST_SHELL="cd ${ANDROID_TMP_FOLDER}/${STAGING_DIR}"
172173
TEST_SHELL="${TEST_SHELL} && ${TEST_CMD}"
173174

174175
# Run test cases a second time with the Swift Testing library

0 commit comments

Comments
 (0)