-
-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add compile time checks to detect Android #90
Conversation
Codecov Report
@@ Coverage Diff @@
## main #90 +/- ##
==========================================
- Coverage 79.76% 79.49% -0.28%
==========================================
Files 63 63
Lines 5170 5170
==========================================
- Hits 4124 4110 -14
- Misses 1046 1060 +14
Continue to review full report at Codecov.
|
@jt9897253 thanks for the PR! Do you think you can add the Android build to the CI? I see some build info here: https://github.com/apple/swift/blob/main/docs/Android.md |
Also, can you add an android badge to the readme? The link I posted earlier states there’s a minimum NDK required |
Yes, sure, I can try to set up an Android CI. However, this looks rather complicated to me and it may take some time until I can look into it. I see two possible approaches:
I'd prefer building the toolchain from source to be able to update the swift version independently from other projects/people. Building the toolchain using the official documentation is definitely an option but also a lot of manual work. Also, I tested various swift android toolchain projects on GitHub which try to automate the build. A lot of what I found was outdated, I ended up using swift-everywhere-toolchain as it worked best for me. |
Definitely looks a little complicated. In addition, the links you pointed to take 5-10 hours to build from source, so we should stay away from that. I think it's okay to use a pre-built toolchain as long as it looks like they update regularly. The If I'm understanding the |
It looks like the current linux CI in the ci.yml "might" contain almost everything we need to build for Android. We might can copy/paste it and try to install the
|
@jt9897253 I'm going to merge this PR so your changes don't get lost and to avoid merge conflicts in the future. If you find out a way to add the Android build to the CI, feel free to open another PR. Thanks for your contribution! |
Builds on Android, tested using the swift-everywhere-toolchain
All instances of
#if os(Linux)
were changed to#if os(Linux) || os(Android)
Additionaly,
ParseConstants.deviceType
was extended for Android.