|
| 1 | +This is a Kotlin Multiplatform project targeting iOS, Desktop (JVM), Server. |
| 2 | + |
| 3 | +* [/composeApp](./composeApp/src) is for code that will be shared across your Compose Multiplatform applications. |
| 4 | + It contains several subfolders: |
| 5 | + - [commonMain](./composeApp/src/commonMain/kotlin) is for code that’s common for all targets. |
| 6 | + - Other folders are for Kotlin code that will be compiled for only the platform indicated in the folder name. |
| 7 | + For example, if you want to use Apple’s CoreCrypto for the iOS part of your Kotlin app, |
| 8 | + the [iosMain](./composeApp/src/iosMain/kotlin) folder would be the right place for such calls. |
| 9 | + Similarly, if you want to edit the Desktop (JVM) specific part, the [jvmMain](./composeApp/src/jvmMain/kotlin) |
| 10 | + folder is the appropriate location. |
| 11 | + |
| 12 | +* [/iosApp](./iosApp/iosApp) contains iOS applications. Even if you’re sharing your UI with Compose Multiplatform, |
| 13 | + you need this entry point for your iOS app. This is also where you should add SwiftUI code for your project. |
| 14 | + |
| 15 | +* [/server](./server/src/main/kotlin) is for the Ktor server application. |
| 16 | + |
| 17 | +* [/shared](./shared/src) is for the code that will be shared between all targets in the project. |
| 18 | + The most important subfolder is [commonMain](./shared/src/commonMain/kotlin). If preferred, you |
| 19 | + can add code to the platform-specific folders here too. |
| 20 | + |
| 21 | +### Build and Run Desktop (JVM) Application |
| 22 | + |
| 23 | +To build and run the development version of the desktop app, use the run configuration from the run widget |
| 24 | +in your IDE’s toolbar or run it directly from the terminal: |
| 25 | +- on macOS/Linux |
| 26 | + ```shell |
| 27 | + ./gradlew :composeApp:run |
| 28 | + ``` |
| 29 | +- on Windows |
| 30 | + ```shell |
| 31 | + .\gradlew.bat :composeApp:run |
| 32 | + ``` |
| 33 | + |
| 34 | +### Build and Run Server |
| 35 | + |
| 36 | +To build and run the development version of the server, use the run configuration from the run widget |
| 37 | +in your IDE’s toolbar or run it directly from the terminal: |
| 38 | +- on macOS/Linux |
| 39 | + ```shell |
| 40 | + ./gradlew :server:run |
| 41 | + ``` |
| 42 | +- on Windows |
| 43 | + ```shell |
| 44 | + .\gradlew.bat :server:run |
| 45 | + ``` |
| 46 | + |
| 47 | +### Build and Run iOS Application |
| 48 | + |
| 49 | +To build and run the development version of the iOS app, use the run configuration from the run widget |
| 50 | +in your IDE’s toolbar or open the [/iosApp](./iosApp) directory in Xcode and run it from there. |
| 51 | + |
| 52 | +--- |
| 53 | + |
| 54 | +Learn more about [Kotlin Multiplatform](https://www.jetbrains.com/help/kotlin-multiplatform-dev/get-started.html)… |
0 commit comments