Skip to content

Commit fe29bf4

Browse files
committed
Cleanup copy of test resources and executables
1 parent 4f63ef2 commit fe29bf4

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

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

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,23 +92,22 @@ log "Prepare Swift test package"
9292
# create a staging folder where we copy the test executable
9393
# and all the dependent libraries to copy over to the emulator
9494
STAGING_DIR="swift-android-test"
95-
rm -rf .build/"${STAGING_DIR}"
96-
mkdir .build/"${STAGING_DIR}"
95+
rm -rf "${STAGING_DIR}"
96+
mkdir "${STAGING_DIR}"
97+
98+
BUILD_DIR=.build/"${ANDROID_SDK_TRIPLE}"/debug
99+
100+
find "${BUILD_DIR}" -name '*.xctest' -o -name '*.resources' -exec cp -a {} "${STAGING_DIR}" \;
101+
102+
# also copy required libraries
103+
cp -a "${SWIFT_ANDROID_SDK_HOME}"/swift-android/swift-resources/usr/lib/swift-"${ANDROID_EMULATOR_ARCH_TRIPLE}"/android/*.so "${SWIFT_ANDROID_SDK_HOME}"/swift-android/ndk-sysroot/usr/lib/"${ANDROID_EMULATOR_ARCH_TRIPLE}"-linux-android/libc++_shared.so "${STAGING_DIR}"
97104

98105
# for the common case of tests referencing
99106
# their own files as hardwired resource paths
100107
if [[ -d Tests ]]; then
101-
cp -a Tests .build/"${STAGING_DIR}"
108+
cp -a Tests "${STAGING_DIR}"
102109
fi
103110

104-
pushd .build/
105-
106-
TEST_PACKAGE=$(find debug/ -name '*.xctest' | tail -n 1 | xargs basename)
107-
cp -a debug/"${TEST_PACKAGE}" "${STAGING_DIR}"
108-
find debug/ -name '*.resources' -exec cp -a {} "${STAGING_DIR}" \;
109-
cp -a "${SWIFT_ANDROID_SDK_HOME}"/swift-android/swift-resources/usr/lib/swift-"${ANDROID_EMULATOR_ARCH_TRIPLE}"/android/*.so "${STAGING_DIR}"
110-
cp -a "${SWIFT_ANDROID_SDK_HOME}"/swift-android/ndk-sysroot/usr/lib/"${ANDROID_EMULATOR_ARCH_TRIPLE}"-linux-android/libc++_shared.so "${STAGING_DIR}"
111-
112111
log "Copy Swift test package to emulator"
113112

114113
ANDROID_TMP_FOLDER="/data/local/tmp/${STAGING_DIR}"

0 commit comments

Comments
 (0)