├── .gitignore ├── gradle.properties ├── app ├── iosApp │ ├── kmpSample │ │ ├── kmpSample │ │ │ ├── Assets.xcassets │ │ │ │ ├── Contents.json │ │ │ │ ├── AccentColor.colorset │ │ │ │ │ └── Contents.json │ │ │ │ └── AppIcon.appiconset │ │ │ │ │ └── Contents.json │ │ │ ├── Preview Content │ │ │ │ └── Preview Assets.xcassets │ │ │ │ │ └── Contents.json │ │ │ ├── ContentView.swift │ │ │ └── kmpSampleApp.swift │ │ └── kmpSample.xcodeproj │ │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ └── project.pbxproj │ └── .gitignore ├── src │ ├── iosMain │ │ └── kotlin │ │ │ └── io │ │ │ └── sellmair │ │ │ └── app │ │ │ └── SampleAppViewController.kt │ ├── jvmMain │ │ └── kotlin │ │ │ └── io │ │ │ └── sellmair │ │ │ └── app │ │ │ └── Main.kt │ ├── commonMain │ │ └── kotlin │ │ │ └── io │ │ │ └── sellmair │ │ │ └── app │ │ │ └── MainScreen.kt │ └── androidMain │ │ ├── kotlin │ │ └── io │ │ │ └── sellmair │ │ │ └── app │ │ │ └── MainActivity.kt │ │ └── AndroidManifest.xml └── build.gradle.kts ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── Readme.md ├── settings.gradle.kts ├── gradlew.bat └── gradlew /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .kotlin 3 | .gradle 4 | **/build -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx6g 2 | android.useAndroidX=true -------------------------------------------------------------------------------- /app/iosApp/kmpSample/kmpSample/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sellmair/kotlin-multiplatform-getting-started/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/iosApp/.gitignore: -------------------------------------------------------------------------------- 1 | xcuserdata/ 2 | *.hmap 3 | *.ipa 4 | *.dSYM.zip 5 | *.dSYM 6 | 7 | timeline.xctimeline 8 | playground.xcworkspace 9 | .build/ 10 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | ## Blogpost: 2 | https://blog.sellmair.io/setting-up-kotlin-multiplatform-compose 3 | 4 | ## Full Setup Tutorial Video: 5 | https://youtu.be/fmFezt-2IBo -------------------------------------------------------------------------------- /app/iosApp/kmpSample/kmpSample/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /app/iosApp/kmpSample/kmpSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/iosApp/kmpSample/kmpSample/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /app/src/iosMain/kotlin/io/sellmair/app/SampleAppViewController.kt: -------------------------------------------------------------------------------- 1 | package io.sellmair.app 2 | 3 | import androidx.compose.ui.window.ComposeUIViewController 4 | 5 | @Suppress("unused") // used by swift code 6 | fun createViewController() = ComposeUIViewController { 7 | MainScreen() 8 | } -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /app/iosApp/kmpSample/kmpSample/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "platform" : "ios", 6 | "size" : "1024x1024" 7 | } 8 | ], 9 | "info" : { 10 | "author" : "xcode", 11 | "version" : 1 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /app/src/jvmMain/kotlin/io/sellmair/app/Main.kt: -------------------------------------------------------------------------------- 1 | package io.sellmair.app 2 | 3 | import androidx.compose.ui.window.Window 4 | import androidx.compose.ui.window.application 5 | 6 | fun main() = application { 7 | Window(title = "KMP Demo", onCloseRequest = ::exitApplication) { 8 | MainScreen() 9 | } 10 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/io/sellmair/app/MainScreen.kt: -------------------------------------------------------------------------------- 1 | package io.sellmair.app 2 | 3 | import androidx.compose.material3.Text 4 | import androidx.compose.runtime.Composable 5 | import androidx.compose.ui.unit.sp 6 | 7 | @Composable 8 | fun MainScreen() { 9 | Text( 10 | "Hello from Kotlin!", 11 | fontSize = 48.sp 12 | ) 13 | } -------------------------------------------------------------------------------- /app/iosApp/kmpSample/kmpSample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/androidMain/kotlin/io/sellmair/app/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package io.sellmair.app 2 | 3 | import android.os.Bundle 4 | import androidx.activity.compose.setContent 5 | import androidx.appcompat.app.AppCompatActivity 6 | 7 | class MainActivity: AppCompatActivity() { 8 | override fun onCreate(savedInstanceState: Bundle?) { 9 | super.onCreate(savedInstanceState) 10 | setContent { 11 | MainScreen() 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /app/iosApp/kmpSample/kmpSample/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // kmpSample 4 | // 5 | // Created by Sebastian Sellmair on 17.07.24. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct ContentView: View { 11 | var body: some View { 12 | VStack { 13 | Image(systemName: "globe") 14 | .imageScale(.large) 15 | .foregroundStyle(.tint) 16 | Text("Hello, world!") 17 | } 18 | .padding() 19 | } 20 | } 21 | 22 | #Preview { 23 | ContentView() 24 | } 25 | -------------------------------------------------------------------------------- /app/src/androidMain/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/iosApp/kmpSample/kmpSample/kmpSampleApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // kmpSampleApp.swift 3 | // kmpSample 4 | // 5 | // Created by Sebastian Sellmair on 17.07.24. 6 | // 7 | 8 | import SwiftUI 9 | import KmpApp 10 | 11 | struct ComposeView: UIViewControllerRepresentable { 12 | func makeUIViewController(context: Context) -> some UIViewController { 13 | SampleAppViewControllerKt.createViewController() 14 | } 15 | 16 | func updateUIViewController(_ uiViewController: UIViewControllerType, context: Context) { 17 | 18 | } 19 | } 20 | 21 | @main 22 | struct kmpSampleApp: App { 23 | var body: some Scene { 24 | WindowGroup { 25 | ComposeView() 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | google { 4 | mavenContent { 5 | includeGroupByRegex(".*google.*") 6 | includeGroupByRegex(".*android.*") 7 | includeGroupByRegex(".*androidx.*") 8 | } 9 | } 10 | 11 | mavenCentral() 12 | } 13 | } 14 | 15 | dependencyResolutionManagement { 16 | repositories { 17 | google { 18 | mavenContent { 19 | includeGroupByRegex(".*google.*") 20 | includeGroupByRegex(".*android.*") 21 | includeGroupByRegex(".*androidx.*") 22 | } 23 | } 24 | 25 | mavenCentral() 26 | } 27 | } 28 | 29 | include(":app") -------------------------------------------------------------------------------- /app/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget 2 | 3 | plugins { 4 | kotlin("multiplatform") 5 | kotlin("plugin.compose") 6 | id("org.jetbrains.compose") 7 | id("com.android.application") 8 | } 9 | 10 | kotlin { 11 | jvmToolchain(17) 12 | 13 | jvm() 14 | androidTarget() 15 | 16 | iosX64() 17 | iosArm64() 18 | iosSimulatorArm64() 19 | 20 | sourceSets.commonMain.dependencies { 21 | implementation(compose.foundation) 22 | implementation(compose.material3) 23 | implementation(compose.runtime) 24 | } 25 | 26 | sourceSets.androidMain.dependencies { 27 | implementation("androidx.activity:activity-compose:1.9.0") 28 | implementation("androidx.appcompat:appcompat:1.7.0") 29 | } 30 | 31 | sourceSets.jvmMain.dependencies { 32 | implementation(compose.desktop.currentOs) 33 | } 34 | } 35 | 36 | /* Android Configuration */ 37 | android { 38 | compileSdk = 34 39 | namespace = "io.sellmair.kmp.getting.started" 40 | 41 | defaultConfig { 42 | minSdk = 29 43 | applicationId = "io.sellmair.kmp.getting.started" 44 | } 45 | } 46 | 47 | /* iOS Configuration */ 48 | kotlin.targets.withType().configureEach { 49 | binaries.framework { 50 | baseName = "KmpApp" 51 | isStatic = true 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | @rem This is normally unused 30 | set APP_BASE_NAME=%~n0 31 | set APP_HOME=%DIRNAME% 32 | 33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 35 | 36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 38 | 39 | @rem Find java.exe 40 | if defined JAVA_HOME goto findJavaFromJavaHome 41 | 42 | set JAVA_EXE=java.exe 43 | %JAVA_EXE% -version >NUL 2>&1 44 | if %ERRORLEVEL% equ 0 goto execute 45 | 46 | echo. 1>&2 47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 48 | echo. 1>&2 49 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 50 | echo location of your Java installation. 1>&2 51 | 52 | goto fail 53 | 54 | :findJavaFromJavaHome 55 | set JAVA_HOME=%JAVA_HOME:"=% 56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 57 | 58 | if exist "%JAVA_EXE%" goto execute 59 | 60 | echo. 1>&2 61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 62 | echo. 1>&2 63 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 64 | echo location of your Java installation. 1>&2 65 | 66 | goto fail 67 | 68 | :execute 69 | @rem Setup the command line 70 | 71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 72 | 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if %ERRORLEVEL% equ 0 goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | set EXIT_CODE=%ERRORLEVEL% 85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 87 | exit /b %EXIT_CODE% 88 | 89 | :mainEnd 90 | if "%OS%"=="Windows_NT" endlocal 91 | 92 | :omega 93 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | # This is normally unused 84 | # shellcheck disable=SC2034 85 | APP_BASE_NAME=${0##*/} 86 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) 87 | APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit 88 | 89 | # Use the maximum available, or set MAX_FD != -1 to use that value. 90 | MAX_FD=maximum 91 | 92 | warn () { 93 | echo "$*" 94 | } >&2 95 | 96 | die () { 97 | echo 98 | echo "$*" 99 | echo 100 | exit 1 101 | } >&2 102 | 103 | # OS specific support (must be 'true' or 'false'). 104 | cygwin=false 105 | msys=false 106 | darwin=false 107 | nonstop=false 108 | case "$( uname )" in #( 109 | CYGWIN* ) cygwin=true ;; #( 110 | Darwin* ) darwin=true ;; #( 111 | MSYS* | MINGW* ) msys=true ;; #( 112 | NONSTOP* ) nonstop=true ;; 113 | esac 114 | 115 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 116 | 117 | 118 | # Determine the Java command to use to start the JVM. 119 | if [ -n "$JAVA_HOME" ] ; then 120 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 121 | # IBM's JDK on AIX uses strange locations for the executables 122 | JAVACMD=$JAVA_HOME/jre/sh/java 123 | else 124 | JAVACMD=$JAVA_HOME/bin/java 125 | fi 126 | if [ ! -x "$JAVACMD" ] ; then 127 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 128 | 129 | Please set the JAVA_HOME variable in your environment to match the 130 | location of your Java installation." 131 | fi 132 | else 133 | JAVACMD=java 134 | if ! command -v java >/dev/null 2>&1 135 | then 136 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | fi 142 | 143 | # Increase the maximum file descriptors if we can. 144 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 145 | case $MAX_FD in #( 146 | max*) 147 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 148 | # shellcheck disable=SC2039,SC3045 149 | MAX_FD=$( ulimit -H -n ) || 150 | warn "Could not query maximum file descriptor limit" 151 | esac 152 | case $MAX_FD in #( 153 | '' | soft) :;; #( 154 | *) 155 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 156 | # shellcheck disable=SC2039,SC3045 157 | ulimit -n "$MAX_FD" || 158 | warn "Could not set maximum file descriptor limit to $MAX_FD" 159 | esac 160 | fi 161 | 162 | # Collect all arguments for the java command, stacking in reverse order: 163 | # * args from the command line 164 | # * the main class name 165 | # * -classpath 166 | # * -D...appname settings 167 | # * --module-path (only if needed) 168 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 169 | 170 | # For Cygwin or MSYS, switch paths to Windows format before running java 171 | if "$cygwin" || "$msys" ; then 172 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 173 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 174 | 175 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 176 | 177 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 178 | for arg do 179 | if 180 | case $arg in #( 181 | -*) false ;; # don't mess with options #( 182 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 183 | [ -e "$t" ] ;; #( 184 | *) false ;; 185 | esac 186 | then 187 | arg=$( cygpath --path --ignore --mixed "$arg" ) 188 | fi 189 | # Roll the args list around exactly as many times as the number of 190 | # args, so each arg winds up back in the position where it started, but 191 | # possibly modified. 192 | # 193 | # NB: a `for` loop captures its iteration list before it begins, so 194 | # changing the positional parameters here affects neither the number of 195 | # iterations, nor the values presented in `arg`. 196 | shift # remove old arg 197 | set -- "$@" "$arg" # push replacement arg 198 | done 199 | fi 200 | 201 | 202 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 203 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 204 | 205 | # Collect all arguments for the java command: 206 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, 207 | # and any embedded shellness will be escaped. 208 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be 209 | # treated as '${Hostname}' itself on the command line. 210 | 211 | set -- \ 212 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 213 | -classpath "$CLASSPATH" \ 214 | org.gradle.wrapper.GradleWrapperMain \ 215 | "$@" 216 | 217 | # Stop when "xargs" is not available. 218 | if ! command -v xargs >/dev/null 2>&1 219 | then 220 | die "xargs is not available" 221 | fi 222 | 223 | # Use "xargs" to parse quoted args. 224 | # 225 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 226 | # 227 | # In Bash we could simply go: 228 | # 229 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 230 | # set -- "${ARGS[@]}" "$@" 231 | # 232 | # but POSIX shell has neither arrays nor command substitution, so instead we 233 | # post-process each arg (as a line of input to sed) to backslash-escape any 234 | # character that might be a shell metacharacter, then use eval to reverse 235 | # that process (while maintaining the separation between arguments), and wrap 236 | # the whole thing up as a single "set" statement. 237 | # 238 | # This will of course break if any of these variables contains a newline or 239 | # an unmatched quote. 240 | # 241 | 242 | eval "set -- $( 243 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 244 | xargs -n1 | 245 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 246 | tr '\n' ' ' 247 | )" '"$@"' 248 | 249 | exec "$JAVACMD" "$@" 250 | -------------------------------------------------------------------------------- /app/iosApp/kmpSample/kmpSample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 56; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | B0DA84882C484E1F00ADCD3F /* kmpSampleApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0DA84872C484E1F00ADCD3F /* kmpSampleApp.swift */; }; 11 | B0DA848A2C484E1F00ADCD3F /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0DA84892C484E1F00ADCD3F /* ContentView.swift */; }; 12 | B0DA848C2C484E2100ADCD3F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B0DA848B2C484E2100ADCD3F /* Assets.xcassets */; }; 13 | B0DA848F2C484E2100ADCD3F /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B0DA848E2C484E2100ADCD3F /* Preview Assets.xcassets */; }; 14 | /* End PBXBuildFile section */ 15 | 16 | /* Begin PBXFileReference section */ 17 | B0DA84842C484E1F00ADCD3F /* kmpSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = kmpSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 18 | B0DA84872C484E1F00ADCD3F /* kmpSampleApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = kmpSampleApp.swift; sourceTree = ""; }; 19 | B0DA84892C484E1F00ADCD3F /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 20 | B0DA848B2C484E2100ADCD3F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 21 | B0DA848E2C484E2100ADCD3F /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 22 | /* End PBXFileReference section */ 23 | 24 | /* Begin PBXFrameworksBuildPhase section */ 25 | B0DA84812C484E1F00ADCD3F /* Frameworks */ = { 26 | isa = PBXFrameworksBuildPhase; 27 | buildActionMask = 2147483647; 28 | files = ( 29 | ); 30 | runOnlyForDeploymentPostprocessing = 0; 31 | }; 32 | /* End PBXFrameworksBuildPhase section */ 33 | 34 | /* Begin PBXGroup section */ 35 | B0DA847B2C484E1F00ADCD3F = { 36 | isa = PBXGroup; 37 | children = ( 38 | B0DA84862C484E1F00ADCD3F /* kmpSample */, 39 | B0DA84852C484E1F00ADCD3F /* Products */, 40 | ); 41 | sourceTree = ""; 42 | }; 43 | B0DA84852C484E1F00ADCD3F /* Products */ = { 44 | isa = PBXGroup; 45 | children = ( 46 | B0DA84842C484E1F00ADCD3F /* kmpSample.app */, 47 | ); 48 | name = Products; 49 | sourceTree = ""; 50 | }; 51 | B0DA84862C484E1F00ADCD3F /* kmpSample */ = { 52 | isa = PBXGroup; 53 | children = ( 54 | B0DA84872C484E1F00ADCD3F /* kmpSampleApp.swift */, 55 | B0DA84892C484E1F00ADCD3F /* ContentView.swift */, 56 | B0DA848B2C484E2100ADCD3F /* Assets.xcassets */, 57 | B0DA848D2C484E2100ADCD3F /* Preview Content */, 58 | ); 59 | path = kmpSample; 60 | sourceTree = ""; 61 | }; 62 | B0DA848D2C484E2100ADCD3F /* Preview Content */ = { 63 | isa = PBXGroup; 64 | children = ( 65 | B0DA848E2C484E2100ADCD3F /* Preview Assets.xcassets */, 66 | ); 67 | path = "Preview Content"; 68 | sourceTree = ""; 69 | }; 70 | /* End PBXGroup section */ 71 | 72 | /* Begin PBXNativeTarget section */ 73 | B0DA84832C484E1F00ADCD3F /* kmpSample */ = { 74 | isa = PBXNativeTarget; 75 | buildConfigurationList = B0DA84922C484E2100ADCD3F /* Build configuration list for PBXNativeTarget "kmpSample" */; 76 | buildPhases = ( 77 | B0DA84952C484E8300ADCD3F /* Compile Kotlin */, 78 | B0DA84802C484E1F00ADCD3F /* Sources */, 79 | B0DA84812C484E1F00ADCD3F /* Frameworks */, 80 | B0DA84822C484E1F00ADCD3F /* Resources */, 81 | ); 82 | buildRules = ( 83 | ); 84 | dependencies = ( 85 | ); 86 | name = kmpSample; 87 | productName = kmpSample; 88 | productReference = B0DA84842C484E1F00ADCD3F /* kmpSample.app */; 89 | productType = "com.apple.product-type.application"; 90 | }; 91 | /* End PBXNativeTarget section */ 92 | 93 | /* Begin PBXProject section */ 94 | B0DA847C2C484E1F00ADCD3F /* Project object */ = { 95 | isa = PBXProject; 96 | attributes = { 97 | BuildIndependentTargetsInParallel = 1; 98 | LastSwiftUpdateCheck = 1540; 99 | LastUpgradeCheck = 1540; 100 | TargetAttributes = { 101 | B0DA84832C484E1F00ADCD3F = { 102 | CreatedOnToolsVersion = 15.4; 103 | }; 104 | }; 105 | }; 106 | buildConfigurationList = B0DA847F2C484E1F00ADCD3F /* Build configuration list for PBXProject "kmpSample" */; 107 | compatibilityVersion = "Xcode 14.0"; 108 | developmentRegion = en; 109 | hasScannedForEncodings = 0; 110 | knownRegions = ( 111 | en, 112 | Base, 113 | ); 114 | mainGroup = B0DA847B2C484E1F00ADCD3F; 115 | productRefGroup = B0DA84852C484E1F00ADCD3F /* Products */; 116 | projectDirPath = ""; 117 | projectRoot = ""; 118 | targets = ( 119 | B0DA84832C484E1F00ADCD3F /* kmpSample */, 120 | ); 121 | }; 122 | /* End PBXProject section */ 123 | 124 | /* Begin PBXResourcesBuildPhase section */ 125 | B0DA84822C484E1F00ADCD3F /* Resources */ = { 126 | isa = PBXResourcesBuildPhase; 127 | buildActionMask = 2147483647; 128 | files = ( 129 | B0DA848F2C484E2100ADCD3F /* Preview Assets.xcassets in Resources */, 130 | B0DA848C2C484E2100ADCD3F /* Assets.xcassets in Resources */, 131 | ); 132 | runOnlyForDeploymentPostprocessing = 0; 133 | }; 134 | /* End PBXResourcesBuildPhase section */ 135 | 136 | /* Begin PBXShellScriptBuildPhase section */ 137 | B0DA84952C484E8300ADCD3F /* Compile Kotlin */ = { 138 | isa = PBXShellScriptBuildPhase; 139 | buildActionMask = 2147483647; 140 | files = ( 141 | ); 142 | inputFileListPaths = ( 143 | ); 144 | inputPaths = ( 145 | ); 146 | name = "Compile Kotlin"; 147 | outputFileListPaths = ( 148 | ); 149 | outputPaths = ( 150 | ); 151 | runOnlyForDeploymentPostprocessing = 0; 152 | shellPath = /bin/sh; 153 | shellScript = "# Type a script or drag a script file from your workspace to insert its path.\ncd \"$SRCROOT/../../../\"\npwd\n./gradlew :app:embedAndSignAppleFrameworkForXcode\n"; 154 | }; 155 | /* End PBXShellScriptBuildPhase section */ 156 | 157 | /* Begin PBXSourcesBuildPhase section */ 158 | B0DA84802C484E1F00ADCD3F /* Sources */ = { 159 | isa = PBXSourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | B0DA848A2C484E1F00ADCD3F /* ContentView.swift in Sources */, 163 | B0DA84882C484E1F00ADCD3F /* kmpSampleApp.swift in Sources */, 164 | ); 165 | runOnlyForDeploymentPostprocessing = 0; 166 | }; 167 | /* End PBXSourcesBuildPhase section */ 168 | 169 | /* Begin XCBuildConfiguration section */ 170 | B0DA84902C484E2100ADCD3F /* Debug */ = { 171 | isa = XCBuildConfiguration; 172 | buildSettings = { 173 | ALWAYS_SEARCH_USER_PATHS = NO; 174 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 175 | CLANG_ANALYZER_NONNULL = YES; 176 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 177 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 178 | CLANG_ENABLE_MODULES = YES; 179 | CLANG_ENABLE_OBJC_ARC = YES; 180 | CLANG_ENABLE_OBJC_WEAK = YES; 181 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 182 | CLANG_WARN_BOOL_CONVERSION = YES; 183 | CLANG_WARN_COMMA = YES; 184 | CLANG_WARN_CONSTANT_CONVERSION = YES; 185 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 186 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 187 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 188 | CLANG_WARN_EMPTY_BODY = YES; 189 | CLANG_WARN_ENUM_CONVERSION = YES; 190 | CLANG_WARN_INFINITE_RECURSION = YES; 191 | CLANG_WARN_INT_CONVERSION = YES; 192 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 193 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 194 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 195 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 196 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 197 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 198 | CLANG_WARN_STRICT_PROTOTYPES = YES; 199 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 200 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 201 | CLANG_WARN_UNREACHABLE_CODE = YES; 202 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 203 | COPY_PHASE_STRIP = NO; 204 | DEBUG_INFORMATION_FORMAT = dwarf; 205 | ENABLE_STRICT_OBJC_MSGSEND = YES; 206 | ENABLE_TESTABILITY = YES; 207 | ENABLE_USER_SCRIPT_SANDBOXING = NO; 208 | GCC_C_LANGUAGE_STANDARD = gnu17; 209 | GCC_DYNAMIC_NO_PIC = NO; 210 | GCC_NO_COMMON_BLOCKS = YES; 211 | GCC_OPTIMIZATION_LEVEL = 0; 212 | GCC_PREPROCESSOR_DEFINITIONS = ( 213 | "DEBUG=1", 214 | "$(inherited)", 215 | ); 216 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 217 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 218 | GCC_WARN_UNDECLARED_SELECTOR = YES; 219 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 220 | GCC_WARN_UNUSED_FUNCTION = YES; 221 | GCC_WARN_UNUSED_VARIABLE = YES; 222 | IPHONEOS_DEPLOYMENT_TARGET = 17.5; 223 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 224 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 225 | MTL_FAST_MATH = YES; 226 | ONLY_ACTIVE_ARCH = YES; 227 | SDKROOT = iphoneos; 228 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; 229 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 230 | }; 231 | name = Debug; 232 | }; 233 | B0DA84912C484E2100ADCD3F /* Release */ = { 234 | isa = XCBuildConfiguration; 235 | buildSettings = { 236 | ALWAYS_SEARCH_USER_PATHS = NO; 237 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 238 | CLANG_ANALYZER_NONNULL = YES; 239 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 240 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 241 | CLANG_ENABLE_MODULES = YES; 242 | CLANG_ENABLE_OBJC_ARC = YES; 243 | CLANG_ENABLE_OBJC_WEAK = YES; 244 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 245 | CLANG_WARN_BOOL_CONVERSION = YES; 246 | CLANG_WARN_COMMA = YES; 247 | CLANG_WARN_CONSTANT_CONVERSION = YES; 248 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 249 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 250 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 251 | CLANG_WARN_EMPTY_BODY = YES; 252 | CLANG_WARN_ENUM_CONVERSION = YES; 253 | CLANG_WARN_INFINITE_RECURSION = YES; 254 | CLANG_WARN_INT_CONVERSION = YES; 255 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 256 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 257 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 258 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 259 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 260 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 261 | CLANG_WARN_STRICT_PROTOTYPES = YES; 262 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 263 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 264 | CLANG_WARN_UNREACHABLE_CODE = YES; 265 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 266 | COPY_PHASE_STRIP = NO; 267 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 268 | ENABLE_NS_ASSERTIONS = NO; 269 | ENABLE_STRICT_OBJC_MSGSEND = YES; 270 | ENABLE_USER_SCRIPT_SANDBOXING = NO; 271 | GCC_C_LANGUAGE_STANDARD = gnu17; 272 | GCC_NO_COMMON_BLOCKS = YES; 273 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 274 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 275 | GCC_WARN_UNDECLARED_SELECTOR = YES; 276 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 277 | GCC_WARN_UNUSED_FUNCTION = YES; 278 | GCC_WARN_UNUSED_VARIABLE = YES; 279 | IPHONEOS_DEPLOYMENT_TARGET = 17.5; 280 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 281 | MTL_ENABLE_DEBUG_INFO = NO; 282 | MTL_FAST_MATH = YES; 283 | SDKROOT = iphoneos; 284 | SWIFT_COMPILATION_MODE = wholemodule; 285 | VALIDATE_PRODUCT = YES; 286 | }; 287 | name = Release; 288 | }; 289 | B0DA84932C484E2100ADCD3F /* Debug */ = { 290 | isa = XCBuildConfiguration; 291 | buildSettings = { 292 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 293 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 294 | CODE_SIGN_STYLE = Automatic; 295 | CURRENT_PROJECT_VERSION = 1; 296 | DEVELOPMENT_ASSET_PATHS = "\"kmpSample/Preview Content\""; 297 | DEVELOPMENT_TEAM = R58Q77NDGL; 298 | ENABLE_PREVIEWS = YES; 299 | ENABLE_USER_SCRIPT_SANDBOXING = NO; 300 | FRAMEWORK_SEARCH_PATHS = "$SRCROOT/../../build/xcode-frameworks/${CONFIGURATION}/${SDK_NAME}"; 301 | GENERATE_INFOPLIST_FILE = YES; 302 | INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; 303 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 304 | INFOPLIST_KEY_UILaunchScreen_Generation = YES; 305 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 306 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 307 | LD_RUNPATH_SEARCH_PATHS = ( 308 | "$(inherited)", 309 | "@executable_path/Frameworks", 310 | ); 311 | MARKETING_VERSION = 1.0; 312 | PRODUCT_BUNDLE_IDENTIFIER = io.sellmair.kmpSample; 313 | PRODUCT_NAME = "$(TARGET_NAME)"; 314 | SWIFT_EMIT_LOC_STRINGS = YES; 315 | SWIFT_VERSION = 5.0; 316 | TARGETED_DEVICE_FAMILY = "1,2"; 317 | }; 318 | name = Debug; 319 | }; 320 | B0DA84942C484E2100ADCD3F /* Release */ = { 321 | isa = XCBuildConfiguration; 322 | buildSettings = { 323 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 324 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 325 | CODE_SIGN_STYLE = Automatic; 326 | CURRENT_PROJECT_VERSION = 1; 327 | DEVELOPMENT_ASSET_PATHS = "\"kmpSample/Preview Content\""; 328 | DEVELOPMENT_TEAM = R58Q77NDGL; 329 | ENABLE_PREVIEWS = YES; 330 | ENABLE_USER_SCRIPT_SANDBOXING = NO; 331 | FRAMEWORK_SEARCH_PATHS = "$SRCROOT/../../build/xcode-frameworks/${CONFIGURATION}/${SDK_NAME}"; 332 | GENERATE_INFOPLIST_FILE = YES; 333 | INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; 334 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 335 | INFOPLIST_KEY_UILaunchScreen_Generation = YES; 336 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 337 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 338 | LD_RUNPATH_SEARCH_PATHS = ( 339 | "$(inherited)", 340 | "@executable_path/Frameworks", 341 | ); 342 | MARKETING_VERSION = 1.0; 343 | PRODUCT_BUNDLE_IDENTIFIER = io.sellmair.kmpSample; 344 | PRODUCT_NAME = "$(TARGET_NAME)"; 345 | SWIFT_EMIT_LOC_STRINGS = YES; 346 | SWIFT_VERSION = 5.0; 347 | TARGETED_DEVICE_FAMILY = "1,2"; 348 | }; 349 | name = Release; 350 | }; 351 | /* End XCBuildConfiguration section */ 352 | 353 | /* Begin XCConfigurationList section */ 354 | B0DA847F2C484E1F00ADCD3F /* Build configuration list for PBXProject "kmpSample" */ = { 355 | isa = XCConfigurationList; 356 | buildConfigurations = ( 357 | B0DA84902C484E2100ADCD3F /* Debug */, 358 | B0DA84912C484E2100ADCD3F /* Release */, 359 | ); 360 | defaultConfigurationIsVisible = 0; 361 | defaultConfigurationName = Release; 362 | }; 363 | B0DA84922C484E2100ADCD3F /* Build configuration list for PBXNativeTarget "kmpSample" */ = { 364 | isa = XCConfigurationList; 365 | buildConfigurations = ( 366 | B0DA84932C484E2100ADCD3F /* Debug */, 367 | B0DA84942C484E2100ADCD3F /* Release */, 368 | ); 369 | defaultConfigurationIsVisible = 0; 370 | defaultConfigurationName = Release; 371 | }; 372 | /* End XCConfigurationList section */ 373 | }; 374 | rootObject = B0DA847C2C484E1F00ADCD3F /* Project object */; 375 | } 376 | --------------------------------------------------------------------------------