longpham2310 / mpp-example

Example of Kotlin multiplatform project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiplatform sample

This example shows how to use Kotlin/Native in the multiplatform world.

This sample based on the multiplatform documentation. If you have questions about the structure or how it works take a look at the documentation there.

iOS

To compile the project from Xcode just open iosApp/iosApp.xcodeproj and run the application. The swift tests also can be executed from Xcode.

To compile a framework for ios simulator from the command line execute:

  > ./gradlew :greeting:build

To compile the framework for a device use the device project property:

  > ./gradlew :greeting:build -Pdevice=true

To run kotlin tests (including the common ones) on an iOS simulator execute:

  > ./gradlew :greeting:iosTest

By default the iPhone 8 simulator is used. One can change this setting using the iosDevice project property:

  > ./gradlew :greeting:iosTest -PiosDevice='iPhone 7'

Android

The application can be built and executed on a device or emulator using Android Studio 3.2 or higher. One can also compile the application and run tests from the command line:

   > ./gradlew :androidApp:build

About

Example of Kotlin multiplatform project

License:Apache License 2.0


Languages

Language:Kotlin 55.3%Language:Swift 44.7%