Add Android build support#4
Merged
Merged
Conversation
Android has no system libsqlite3, so force the SQLiteSwiftCSQLite trait instead of relying on SQLite.swift's os(Linux)-only default.
The published Android Swift SDK artifact bundle is built against 6.3.2; a newer host compiler can't import its precompiled modules.
Installs the matching NDK and Swift Android SDK artifact bundle on a macOS runner, then builds debug and release for aarch64-android.
Nested virtualization for the emulator isn't available on the macOS runner used for the build job, so this runs on ubuntu-latest via the swift-android-action, pinned to the same SDK artifact bundle already used for building.
…puts swift-actions/setup-swift doesn't yet recognize 6.3.2 on macOS, so install it directly with swiftly instead. Also drop custom-sdk-url without installed-sdk on the emulator test job, which the action rejects; its default resolution already fetches the same official 6.3.2 android-sdk artifact bundle.
macOS and Linux keep SQLite.swift's own default trait for the platform (system SQLite on Apple, embedded on Linux); Android is the only target that needs the embedded copy forced, detected via the TARGET_OS_ANDROID env var set when cross-compiling.
…uild The iOS job builds for the simulator platform and runs the test suite against a dynamically selected available iPhone simulator, so it doesn't depend on any particular simulator name existing on the runner image. The Android job now exports TARGET_OS_ANDROID=1 so Package.swift picks the embedded SQLite trait.
Xcode's explicit-module build system was caching the Release CoreModelSQLite module without testability even on a clean DerivedData, breaking @testable import; ENABLE_TESTABILITY=YES forces it regardless of configuration. Also point the plain Build step at the device platform instead of the simulator so it can't collide with the Test step's simulator DerivedData.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SQLiteSwiftCSQLite) trait so SQLite.swift doesn't require a systemlibsqlite3, which Android lacksaarch64-unknown-linux-android28Test plan
swift build --swift-sdk aarch64-unknown-linux-android28 -c debugsucceeds locally, producing aarch64 ELF objectsswift build --swift-sdk aarch64-unknown-linux-android28 -c releasesucceeds locallyswift build --swift-sdk aarch64-unknown-linux-android28 --build-testssucceeds locally