Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true

[*.{kt,kts}]
ktlint_function_naming_ignore_when_annotated_with=Composable

[**/generated/**/*]
ktlint = disabled
11 changes: 5 additions & 6 deletions composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

Expand All @@ -7,6 +6,7 @@ plugins {
alias(libs.plugins.androidApplication)
alias(libs.plugins.jetbrainsCompose)
alias(libs.plugins.compose.compiler)
id("org.jlleitschuh.gradle.ktlint") version "12.1.1"
}

kotlin {
Expand All @@ -16,20 +16,20 @@ kotlin {
jvmTarget.set(JvmTarget.JVM_11)
}
}

listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
iosSimulatorArm64(),
).forEach { iosTarget ->
iosTarget.binaries.framework {
baseName = "ComposeApp"
isStatic = true
}
}

sourceSets {

androidMain.dependencies {
implementation(compose.preview)
implementation(libs.androidx.activity.compose)
Expand Down Expand Up @@ -81,4 +81,3 @@ android {
debugImplementation(compose.uiTooling)
}
}

2 changes: 1 addition & 1 deletion composeApp/src/androidMain/kotlin/Platform.android.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ class AndroidPlatform : Platform {
override val name: String = "Android ${Build.VERSION.SDK_INT}"
}

actual fun getPlatform(): Platform = AndroidPlatform()
actual fun getPlatform(): Platform = AndroidPlatform()
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ class MainActivity : ComponentActivity() {
@Composable
fun AppAndroidPreview() {
App()
}
}
2 changes: 1 addition & 1 deletion composeApp/src/commonMain/kotlin/App.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import androidx.compose.runtime.*
import androidx.compose.runtime.Composable

@Composable
fun App() {}
2 changes: 1 addition & 1 deletion composeApp/src/commonMain/kotlin/Platform.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ interface Platform {
val name: String
}

expect fun getPlatform(): Platform
expect fun getPlatform(): Platform
3 changes: 2 additions & 1 deletion composeApp/src/iosMain/kotlin/MainViewController.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import androidx.compose.ui.window.ComposeUIViewController

fun MainViewController() = ComposeUIViewController { App() }
@Suppress("FunctionName")
fun MainViewController() = ComposeUIViewController { App() }
4 changes: 2 additions & 2 deletions composeApp/src/iosMain/kotlin/Platform.ios.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import platform.UIKit.UIDevice

class IOSPlatform: Platform {
class IOSPlatform : Platform {
override val name: String = UIDevice.currentDevice.systemName() + " " + UIDevice.currentDevice.systemVersion
}

actual fun getPlatform(): Platform = IOSPlatform()
actual fun getPlatform(): Platform = IOSPlatform()