Contributing
Skip welcomes community contributions in all forms. There are many ways to contribute:
- Submit pull requests to third-party Swift libraries so that they can join our Swift Everywhere initiative, with thousands of packages already compiling for Android. See the porting guide for helpful tips.
- Contribute to SkipStack, Skip’s open source re-implementations of fundamental Swift frameworks like Foundation for transpiled Swift. Each library’s README includes background information such as its current status, any important implementation strategies employed, etc. Please review the README before contributing. When you are ready to submit an update, create a standard GitHub pull request. Skip’s development team will attempt to address PRs as quickly as possible.
- Contribute to SkipUI and SkipFuseUI, which are used by native and transpiled Swift alike! Help expand and improve SwiftUI support on Android. As with other Skip modules, please review the README, and submit a standard GitHub pull request.
Remember that you are not required to contribute updates you make. But we sincerely hope that you will: your improvements to the Swift ecosystem and to Skip’s open source libraries will benefit all Swift-for-Android developers, and by extension all users of Swift-on-Android apps.
Local Skip Libraries
If you’d like to make local changes to Skip’s libraries while working on an app - or to work on SkipUI and exercise your changes with its Showcase app - you will want to configure Xcode to use local library versions rather than the current Skip distributions. This is easily accomplished with an Xcode Workspace.
-
Clone the repositories you’d like to work on. We find it most convenient to make the clone directory a peer of your app directory.
> ls hello-skip/ skip-foundation/ skip-ui/
- Use Xcode to create a new Workspace in the same directory.
- Add your app’s
.xcodeproj
file to the Workspace. - Add your local module directories to the Workspace. Adding these local packages will override the distributions specified in
Package.swift
, so that changes to the local packages will get used in your app build. - Use the Workspace to iterate on your app and the libraries in tandem.
You are now set up to work on Skip libraries! This is a great way to fix any issues or add any missing functionality that is affecting your app, while potentially helping the entire Skip community.
Working in Android Studio
Launching your app from Android Studio will not use your Workspace’s local libraries by default. If you’d like to work in Android Studio, edit your app’s Android/settings.gradle.kts
file to point Android Studio at Xcode’s build, as described in Platform Customization.
If Android Studio appears to be stuck on the official library releases rather than your local versions, use its File → Sync Project with Gradle Files
command to force Android Studio to re-evaluate settings.gradle.kts
.
Community Libraries
Our Swift Everywhere site tracks thousands of Swift packages that compile natively for Android. It builds on the incredible Swift Package Index, pulling each package that supports Linux and attempting to build it for Android as well. Submit your own Linux and Android-supporting packages to the Swift Package Index to automatically include them in Swift Everywhere.
Skip users can utilize transpiled packages in addition to native ones. Transpiled packages are useful both to full transpiled apps, and - when bridging is applied - to native apps that want to interface with Kotlin libraries. If you’ve created a transpiled library that you think might be useful to other Skip users, please consider opening it up to the Skip community. Contact us to have your library listed as a Skip community library.
Tips
If you’re working on a transpiled library that involves heavy use of Kotlin API, you might find it faster to open your module in Android Studio and iterate there even if you want the final code to be in Swift. The idea is to prototype in Android Studio using Kotlin, then back-port the solution to your Swift codebase. We have found this particularly useful when implementing SwiftUI features on top of Compose. Android Studio provides robust autocompletion, inline documentation, and automatic imports
of the myriad of Compose packages. It is also extremely fast to build and run, which helps a lot when you’re experimenting. Our general strategy when implementing a major SkipUI module feature is:
- Make sure you’re set up for local library development. Don’t forget to point Android Studio at your local libraries.
- Stub out the feature in Swift and Xcode.
- Build your app (in the case of SkipUI work, we use the Showcase app) so that your Swift stubs are transpiled.
- Open the app in Android Studio.
- Iterate on the implementation in Android Studio using pure Kotlin/Compose. Yes, this involves editing the transpiled file containing your stubs, and you may even have to override the file’s read-only flag to do so. Take care not to run an Xcode build during this phase, because it will overwrite the file with its own transpilation.
- Once you have settled on your Android implementation, use it to fill in your Swift stubs. You can do this by separating it into an included Kotlin file whose API you call from Swift, or by back-porting the Kotlin you wrote into inline Swift.
Again, we only recommend this process when your implementation is going to require heavy use of Kotlin API and a healthy amount of iteration and experimentation. In that case, the speed of using Android’s native IDE to figure out what works more than makes up for the extra few minutes it takes to clean up the final solution.