diff --git a/components/Kapp/demo/build.gradle.kts b/components/Kapp/demo/build.gradle.kts index 13a43db520..77dc3b6885 100644 --- a/components/Kapp/demo/build.gradle.kts +++ b/components/Kapp/demo/build.gradle.kts @@ -16,10 +16,23 @@ kotlin { } if (withNative) { + macosX64 { + binaries { + executable { + entryPoint = "org.jetbrains.compose.kapp.demo.main" + freeCompilerArgs += listOf( + "-linker-option", "-framework", "-linker-option", "Metal", + "-linker-option", "-framework", "-linker-option", "CoreText", + "-linker-option", "-framework", "-linker-option", "CoreGraphics" + ) + } + } + } + iosX64("uikitX64") { binaries { executable { - entryPoint = "main" + entryPoint = "org.jetbrains.compose.kapp.demo.main" freeCompilerArgs += listOf( "-linker-option", "-framework", "-linker-option", "Metal", "-linker-option", "-framework", "-linker-option", "CoreText", @@ -28,6 +41,7 @@ kotlin { } } } + /* iosArm64("uikitArm64") { binaries { executable { @@ -39,7 +53,7 @@ kotlin { ) } } - } + }*/ } sourceSets { @@ -59,15 +73,28 @@ kotlin { val jsMain by getting if (withNative) { - val uikitMain by creating { + val darwinMain by creating { dependsOn(commonMain) } - val uikitX64Main by getting { - dependsOn(uikitMain) + + val macosMain by creating { + dependsOn(darwinMain) + } + + val macosX64Main by getting { + dependsOn(macosMain) + } + + val uikitMain by creating { + dependsOn(darwinMain) } - val uikitArm64Main by getting { + + val uikitX64Main by getting { dependsOn(uikitMain) } + //val uikitArm64Main by getting { + // dependsOn(uikitMain) + //} } } } diff --git a/components/Kapp/demo/src/darwinMain/kotlin/org/jetbrains/compose/kapp/demo/Simple.darwin.kt b/components/Kapp/demo/src/darwinMain/kotlin/org/jetbrains/compose/kapp/demo/Simple.darwin.kt new file mode 100644 index 0000000000..e5b0b0ffc9 --- /dev/null +++ b/components/Kapp/demo/src/darwinMain/kotlin/org/jetbrains/compose/kapp/demo/Simple.darwin.kt @@ -0,0 +1,5 @@ +package org.jetbrains.compose.kapp.demo + +import androidx.compose.runtime.Composable + +fun main() = simpleDemoApp() diff --git a/components/Kapp/library/build.gradle.kts b/components/Kapp/library/build.gradle.kts index 0c00d27f8b..4347a60e91 100644 --- a/components/Kapp/library/build.gradle.kts +++ b/components/Kapp/library/build.gradle.kts @@ -17,7 +17,7 @@ kotlin { if (withNative) { iosX64("uikitX64") - iosArm64("uikitArm64") + //iosArm64("uikitArm64") } sourceSets { @@ -37,6 +37,18 @@ kotlin { val jsMain by getting if (withNative) { + val darwinMain by creating { + dependsOn(commonMain) + } + + val macosMain by creating { + dependsOn(darwinMain) + } + + val macosX64Main by creating { + dependsOn(macosMain) + } + val uikitMain by creating { dependsOn(commonMain) } @@ -44,9 +56,10 @@ kotlin { val uikitX64Main by getting { dependsOn(uikitMain) } + /* val uikitArm64Main by getting { dependsOn(uikitMain) - } + } */ } } } diff --git a/components/Kapp/library/src/uikitMain/kotlin/org/jetbrains/compose/kapp/KApp.uikit.kt b/components/Kapp/library/src/uikitMain/kotlin/org/jetbrains/compose/kapp/KApp.uikit.kt index ca1e7e7ba1..a06d04738a 100644 --- a/components/Kapp/library/src/uikitMain/kotlin/org/jetbrains/compose/kapp/KApp.uikit.kt +++ b/components/Kapp/library/src/uikitMain/kotlin/org/jetbrains/compose/kapp/KApp.uikit.kt @@ -3,6 +3,7 @@ package org.jetbrains.compose.kapp import androidx.compose.runtime.* import androidx.compose.ui.window.* +import kotlinx.cinterop.* import platform.UIKit.* import platform.Foundation.* diff --git a/components/gradle.properties b/components/gradle.properties index 04d868b5d0..0f291937d4 100644 --- a/components/gradle.properties +++ b/components/gradle.properties @@ -6,3 +6,6 @@ kotlin.code.style=official kotlin.version=1.6.10 # __LATEST_COMPOSE_RELEASE_VERSION__ compose.version=1.2.0-alpha01-dev602 +# TODO: remove after 1.6.20 +kotlin.mpp.enableGranularSourceSetsMetadata=true +kotlin.native.enableDependencyPropagation=false