Skip to content
Closed
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
2 changes: 1 addition & 1 deletion .fleet/run.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "gradle",
"workingDir": "$PROJECT_DIR$",
"tasks": ["jvmRun"],
"args": ["-DmainClass=MainKt", "--quiet", "-p", "$PROJECT_DIR$/composeApp"],
"args": ["-DmainClass=Main_desktopKt", "--quiet", "-p", "$PROJECT_DIR$/composeApp"],
"initScripts": {
"flmapper": "ext.mapPath = { path -> null }"
}
Expand Down
2 changes: 1 addition & 1 deletion .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

86 changes: 49 additions & 37 deletions composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,34 @@ import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile

val enableIos = System.getProperty("os.name").lowercase().contains("mac")

plugins {
alias(libs.plugins.android)
alias(libs.plugins.kotlin)
alias(libs.plugins.compose.core)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.cocoapods)
if (enableIos) {
alias(libs.plugins.cocoapods)
}
alias(libs.plugins.room)
alias(libs.plugins.ksp)
}

version = "1.0"

kotlin {
cocoapods {
summary = "PlayZone iOS SDK"
homepage = "https://google.com"
ios.deploymentTarget = "14.0"

framework {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
transitiveExport = false
baseName = "SharedSDK"
if (enableIos) {
cocoapods {
summary = "PlayZone iOS SDK"
homepage = "https://google.com"
ios.deploymentTarget = "14.0"

framework {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
transitiveExport = false
baseName = "SharedSDK"
}
}
}

Expand All @@ -38,27 +44,28 @@ kotlin {
}
jvm()

// For now Room doesn't work with JS
// js {
// moduleName = "composeApp"
// browser {
// commonWebpackConfig {
// outputFileName = "composeApp.js"
// }
// }
// binaries.executable()
// }

listOf(
iosArm64(),
iosX64(),
iosSimulatorArm64()
).forEach {
it.binaries.framework {
baseName = "ComposeApp"
isStatic = true
// Required when using NativeSQLiteDriver
linkerOpts.add("-lsqlite3")
js {
moduleName = "composeApp"
browser {
commonWebpackConfig {
outputFileName = "composeApp.js"
}
}
binaries.executable()
}

if (enableIos) {
listOf(
iosArm64(),
iosX64(),
iosSimulatorArm64()
).forEach {
it.binaries.framework {
baseName = "ComposeApp"
isStatic = true
// Required when using NativeSQLiteDriver
linkerOpts.add("-lsqlite3")
}
}
}

Expand Down Expand Up @@ -119,8 +126,10 @@ kotlin {
implementation(devNpm("copy-webpack-plugin", "9.1.0"))
}

iosMain.dependencies {
implementation(libs.coil.multiplatform.network.ktor)
if (enableIos) {
maybeCreate("iosMain").dependencies {
implementation(libs.coil.multiplatform.network.ktor)
}
}

commonTest.dependencies {
Expand Down Expand Up @@ -220,12 +229,15 @@ compose.resources {
dependencies {
add("kspCommonMainMetadata", libs.room.compiler)
add("kspAndroid", libs.room.compiler)
// add("kspIosX64", libs.room.compiler)
// add("kspIosArm64", libs.room.compiler)
// add("kspIosSimulatorArm64", libs.room.compiler)
if (enableIos) {
add("kspIosX64", libs.room.compiler)
add("kspIosArm64", libs.room.compiler)
add("kspIosSimulatorArm64", libs.room.compiler)
}
add("kspJvm", libs.room.compiler)
add("kspJs", libs.room.compiler)
}

room {
schemaDirectory("$projectDir/schemas")
}
}
12 changes: 0 additions & 12 deletions composeApp/src/jvmMain/kotlin/Main.kt

This file was deleted.

2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ android.useAndroidX=true
#MPP
kotlin.mpp.enableCInteropCommonization=true
kotlin.native.binary.memoryModel=experimental
org.jetbrains.compose.experimental.jscanvas.enabled=true
org.jetbrains.compose.experimental.jscanvas.enabled=true
Loading