Skip to content

Example SkipFuse library that demonstrates bridging with kotlincompat and unit testing

License

Notifications You must be signed in to change notification settings

skiptools/skip-fuse-samples

Repository files navigation

SkipFuseSamples

This project demonstrates a native Swift SkipFuse library that can be built for both Android and Darwin platforms, as well as a transpiled SkipFuseSamplesTests module that demonstrates accessing the bridged Swift from the Kotlin.

The main components of this package are:

Tests can be run locally from Xcode, which will build and run using the local JVM on the macOS host using the Robolectic Android emulation libraries. To run tests against an actual Android emulator or device, set the environment ANDROID_SERIAL to the identifier of the emulator (usually "emulator-5554") or device and then run the test cases. See https://skip.dev/docs/testing for testing details, and for more information on creating a hybrid project that follows this project's structure', see https://skip.dev/blog/skip-native-tech-preview/.

Tests can also be run locally from the command-line with:

swift test

and against an emulator with:

ANDROID_SERIAL=emulator-5554 swift test

Building

This project is a free Swift Package Manager module that uses the Skip plugin to transpile Swift into Kotlin.

Building the module requires that Skip be installed using Homebrew with brew install skiptools/skip/skip. This will also install the necessary build prerequisites: Kotlin, Gradle, and the Android build tools.

Testing

The module can be tested using the standard swift test command or by running the test target for the macOS destination in Xcode, which will run the Swift tests as well as the transpiled Kotlin JUnit tests in the Robolectric Android simulation environment.

Parity testing can be performed with skip test, which will output a table of the test results for both platforms.

License

This software is licensed under the GNU Lesser General Public License v3.0, with a linking exception to clarify that distribution to restricted environments (e.g., app stores) is permitted.

About

Example SkipFuse library that demonstrates bridging with kotlincompat and unit testing

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Languages