-
Notifications
You must be signed in to change notification settings - Fork 64
/
Copy pathbuild.gradle.kts
executable file
·117 lines (100 loc) · 3.41 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
@file:Suppress("OPT_IN_IS_NOT_ENABLED")
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig
plugins {
kotlin("multiplatform")
// kotlin("native.cocoapods")
id("com.android.library")
id("org.jetbrains.compose")
kotlin("plugin.serialization")
}
version = "1.0-SNAPSHOT"
val ktorVersion = extra["ktor.version"]
kotlin {
android()
jvm("desktop")
// ios()
// iosSimulatorArm64()
js(IR) {
browser()
}
wasm {
browser()
}
// cocoapods {
// summary = "Shared code for the sample"
// homepage = "https://github.com/JetBrains/compose-jb"
// ios.deploymentTarget = "14.1"
// podfile = project.file("../iosApp/Podfile")
// framework {
// baseName = "shared"
// isStatic = true
// }
// extraSpecAttributes["resources"] = "['src/commonMain/resources/**', 'src/iosMain/resources/**']"
// }
sourceSets {
val commonMain by getting {
dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material)
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
implementation(compose.material3)
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
implementation(compose.components.resources)
// implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1")
}
}
val jsWasmMain by creating {
dependsOn(commonMain)
}
val jsMain by getting {
dependsOn(jsWasmMain)
dependencies {
implementation("io.ktor:ktor-client-core:$ktorVersion")
}
}
val wasmMain by getting {
dependsOn(jsWasmMain)
}
val androidMain by getting {
dependencies {
api("androidx.activity:activity-compose:1.6.1")
api("androidx.appcompat:appcompat:1.6.1")
api("androidx.core:core-ktx:1.9.0")
implementation("io.ktor:ktor-client-okhttp:$ktorVersion")
}
}
// val iosMain by getting {
// dependencies {
// implementation("io.ktor:ktor-client-darwin:$ktorVersion")
// }
// }
// val iosSimulatorArm64Main by getting {
// dependsOn(iosMain)
// }
val desktopMain by getting {
dependencies {
implementation(compose.desktop.common)
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-swing:1.6.4")
implementation("io.ktor:ktor-client-cio:$ktorVersion")
}
}
}
}
android {
compileSdk = 33
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
sourceSets["main"].res.srcDirs("src/androidMain/res")
sourceSets["main"].resources.srcDirs("src/commonMain/resources")
defaultConfig {
minSdk = 26
targetSdk = 33
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}
// Use a proper version of webpack, TODO remove after updating to Kotlin 1.9.
rootProject.the<NodeJsRootExtension>().versions.webpack.version = "5.76.2"