Skip to content

Add Android support - #23

Open
finagolfin wants to merge 1 commit into
apple:mainfrom
finagolfin:droid
Open

finagolfin wants to merge 1 commit into
apple:mainfrom
finagolfin:droid

Conversation

@finagolfin

Copy link
Copy Markdown

With these minor tweaks, I was able to build and run all the tests natively on Android against API 24 with a Sep. 21 trunk snapshot toolchain.

#endif
#if canImport(SwiftTLS) && (os(Linux) || !canImport(CryptoKitPrivate))
// For importing the SwiftTLS package on the public SDK or on Linux
#if canImport(SwiftTLS) && !canImport(CryptoKitPrivate)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CryptoKitPrivate is unavailable on non-Darwin, so this check suffices outside Darwin?

Comment thread Package.swift
]

#if os(Linux)
#if os(Linux) || os(Android)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considered !os(anyAppleOS) instead, but that won't work on 6.3, which still appears to be supported here.

#if os(Linux)
import Crypto
#else
#if canImport(CryptoKit)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the order of imports changed here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason, just followed the order used in other files in this repo.

@finagolfin

Copy link
Copy Markdown
Author

@agnosticdev, simple pull, please review.

@finagolfin

Copy link
Copy Markdown
Author

@tfpauly, this passed CI weeks ago, mind reviewing?

With these minor tweaks, I was able to build and run all the tests natively on
Android against API 24 with a Sep. 21 trunk snapshot toolchain.
enable_windows_checks: false
enable_android_sdk_build: false
enable_embedded_wasm_sdk_build: false
enable_linux_static_sdk_build: false

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These SDKs are not built by default so removed them, the converse for linux above.

macos_exclude_xcode_versions: "[{\"xcode_version\": \"swift_6.1\"}, {\"xcode_version\": \"swift_6.2\"}]"
enable_linux_checks: true
linux_swift_versions: '["nightly-main", "nightly-6.3"]'
linux_exclude_swift_versions: '[{"swift_version": "6.4"}]'

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Easier to just exclude the latest release, if that is what's wanted going forward too

@finagolfin

Copy link
Copy Markdown
Author

Rebased and cleaned up the CI workflow, including bumping to the latest tag, verified again by building and testing this repo natively on my Android phone in the Termux app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants