Browse Source

Add macos

app-api
Nikolay Igotti 3 years ago
parent
commit
9f26b9e2f5
  1. 39
      components/Kapp/demo/build.gradle.kts
  2. 5
      components/Kapp/demo/src/darwinMain/kotlin/org/jetbrains/compose/kapp/demo/Simple.darwin.kt
  3. 17
      components/Kapp/library/build.gradle.kts
  4. 1
      components/Kapp/library/src/uikitMain/kotlin/org/jetbrains/compose/kapp/KApp.uikit.kt
  5. 3
      components/gradle.properties

39
components/Kapp/demo/build.gradle.kts

@ -16,10 +16,23 @@ kotlin {
} }
if (withNative) { 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") { iosX64("uikitX64") {
binaries { binaries {
executable { executable {
entryPoint = "main" entryPoint = "org.jetbrains.compose.kapp.demo.main"
freeCompilerArgs += listOf( freeCompilerArgs += listOf(
"-linker-option", "-framework", "-linker-option", "Metal", "-linker-option", "-framework", "-linker-option", "Metal",
"-linker-option", "-framework", "-linker-option", "CoreText", "-linker-option", "-framework", "-linker-option", "CoreText",
@ -28,6 +41,7 @@ kotlin {
} }
} }
} }
/*
iosArm64("uikitArm64") { iosArm64("uikitArm64") {
binaries { binaries {
executable { executable {
@ -39,7 +53,7 @@ kotlin {
) )
} }
} }
} }*/
} }
sourceSets { sourceSets {
@ -59,15 +73,28 @@ kotlin {
val jsMain by getting val jsMain by getting
if (withNative) { if (withNative) {
val uikitMain by creating { val darwinMain by creating {
dependsOn(commonMain) 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) dependsOn(uikitMain)
} }
//val uikitArm64Main by getting {
// dependsOn(uikitMain)
//}
} }
} }
} }

5
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()

17
components/Kapp/library/build.gradle.kts

@ -17,7 +17,7 @@ kotlin {
if (withNative) { if (withNative) {
iosX64("uikitX64") iosX64("uikitX64")
iosArm64("uikitArm64") //iosArm64("uikitArm64")
} }
sourceSets { sourceSets {
@ -37,6 +37,18 @@ kotlin {
val jsMain by getting val jsMain by getting
if (withNative) { if (withNative) {
val darwinMain by creating {
dependsOn(commonMain)
}
val macosMain by creating {
dependsOn(darwinMain)
}
val macosX64Main by creating {
dependsOn(macosMain)
}
val uikitMain by creating { val uikitMain by creating {
dependsOn(commonMain) dependsOn(commonMain)
} }
@ -44,9 +56,10 @@ kotlin {
val uikitX64Main by getting { val uikitX64Main by getting {
dependsOn(uikitMain) dependsOn(uikitMain)
} }
/*
val uikitArm64Main by getting { val uikitArm64Main by getting {
dependsOn(uikitMain) dependsOn(uikitMain)
} } */
} }
} }
} }

1
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.runtime.*
import androidx.compose.ui.window.* import androidx.compose.ui.window.*
import kotlinx.cinterop.*
import platform.UIKit.* import platform.UIKit.*
import platform.Foundation.* import platform.Foundation.*

3
components/gradle.properties

@ -6,3 +6,6 @@ kotlin.code.style=official
kotlin.version=1.6.10 kotlin.version=1.6.10
# __LATEST_COMPOSE_RELEASE_VERSION__ # __LATEST_COMPOSE_RELEASE_VERSION__
compose.version=1.2.0-alpha01-dev602 compose.version=1.2.0-alpha01-dev602
# TODO: remove after 1.6.20
kotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.native.enableDependencyPropagation=false

Loading…
Cancel
Save