Skip to content

Commit 11f9ecf

Browse files
committed
Change default Android SDK build command
Updated default build command for Android SDK to use 'swift build' instead of 'swift build --build-system native'. The 4/27 snapshot contains the requisite changes for Android to work. For Wasm, we want to wait until swiftlang/swift-build#1348 lands before unpinning.
1 parent 3280fe0 commit 11f9ecf

3 files changed

Lines changed: 16 additions & 3 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ STAGING_DIR="swift-android-test"
122122
rm -rf "${STAGING_DIR}"
123123
mkdir "${STAGING_DIR}"
124124

125-
BUILD_DIR=.build/"${ANDROID_SDK_TRIPLE}"/debug
125+
BUILD_DIR=$(swift build --show-bin-path --swift-sdk "${ANDROID_SDK_TRIPLE}")
126126

127127
find "${BUILD_DIR}" -name '*.xctest' -exec cp -av {} "${STAGING_DIR}" \;
128128
find "${BUILD_DIR}" -name '*.resources' -exec cp -av {} "${STAGING_DIR}" \;

.github/workflows/scripts/install-and-build-with-sdk.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,20 @@ if [[ "$INSTALL_WASM" == true ]]; then
653653
fi
654654
fi
655655

656+
# Make the custom toolchain available to subsequent workflow steps
657+
for _exec_var in "$SWIFT_EXECUTABLE_FOR_ANDROID_SDK" "$SWIFT_EXECUTABLE_FOR_STATIC_LINUX_SDK" "$SWIFT_EXECUTABLE_FOR_WASM_SDK"; do
658+
if [[ -n "$_exec_var" && "$_exec_var" != "swift" ]]; then
659+
_bin_dir="$(dirname "$_exec_var")"
660+
log "Adding custom toolchain to PATH: $_bin_dir"
661+
export PATH="$_bin_dir:$PATH"
662+
if [[ -n "${GITHUB_PATH:-}" ]]; then
663+
echo "$_bin_dir" >> "$GITHUB_PATH"
664+
fi
665+
break
666+
fi
667+
done
668+
unset _exec_var _bin_dir
669+
656670
ANDROID_SDK_DOWNLOAD_ROOT="${SWIFT_DOWNLOAD_ROOT}/${SWIFT_VERSION_BRANCH}/android-sdk"
657671
STATIC_LINUX_SDK_DOWNLOAD_ROOT="${SWIFT_DOWNLOAD_ROOT}/${SWIFT_VERSION_BRANCH}/static-sdk"
658672
WASM_SDK_DOWNLOAD_ROOT="${SWIFT_DOWNLOAD_ROOT}/${SWIFT_VERSION_BRANCH}/wasm-sdk"

.github/workflows/swift_package_test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,7 @@ on:
171171
android_sdk_build_command:
172172
type: string
173173
description: "Command to use when building the package with the Swift SDK for Android"
174-
# Temporarily use native build system on Android due to https://github.com/swiftlang/swift/issues/88282
175-
default: "swift build --build-system native"
174+
default: "swift build"
176175
android_sdk_triples:
177176
type: string
178177
description: "The triples to use when building with the Swift SDK for Android. The final triple in the list will be used for the emulator testing and should match the host architecture."

0 commit comments

Comments
 (0)