summaryrefslogtreecommitdiff
path: root/sw-ui/build.gradle.kts
diff options
context:
space:
mode:
authorJoffrey Bion <joffrey.bion@gmail.com>2023-07-06 00:16:45 +0200
committerJoffrey Bion <joffrey.bion@gmail.com>2023-07-06 00:30:55 +0200
commitcdaae5279e3f53c146df2500a8d7a1d4eae2f674 (patch)
tree55347f2839caaf4688f4f989e9568ffd7102db63 /sw-ui/build.gradle.kts
parentUpgrade Kotlin JS wrappers to 1.0.0-pre.585 (diff)
downloadseven-wonders-cdaae5279e3f53c146df2500a8d7a1d4eae2f674.tar.gz
seven-wonders-cdaae5279e3f53c146df2500a8d7a1d4eae2f674.tar.bz2
seven-wonders-cdaae5279e3f53c146df2500a8d7a1d4eae2f674.zip
Convert sw-ui module to Kotlin Multiplatform gradle pluginmain
Diffstat (limited to 'sw-ui/build.gradle.kts')
-rw-r--r--sw-ui/build.gradle.kts22
1 files changed, 10 insertions, 12 deletions
diff --git a/sw-ui/build.gradle.kts b/sw-ui/build.gradle.kts
index 0b736e34..2efb54ab 100644
--- a/sw-ui/build.gradle.kts
+++ b/sw-ui/build.gradle.kts
@@ -1,7 +1,7 @@
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpack
plugins {
- kotlin("js")
+ kotlin("multiplatform")
}
kotlin {
@@ -11,12 +11,11 @@ kotlin {
useCommonJs()
}
sourceSets {
- main {
+ val jsMain by getting {
dependencies {
implementation(projects.swClient)
implementation(libs.kotlinx.coroutines.core)
- implementation(libs.kotlinx.coroutines.test)
implementation(platform(libs.kotlin.wrappers.bom.get()))
implementation(libs.kotlin.wrappers.react.base)
@@ -28,23 +27,22 @@ kotlin {
implementation(libs.kotlin.wrappers.emotion)
}
}
- test {
+ val jsTest by getting {
dependencies {
implementation(kotlin("test-js"))
+ implementation(libs.kotlinx.coroutines.test)
}
}
}
}
-tasks {
- "processResources"(ProcessResources::class) {
- val webpack = project.tasks.withType(KotlinWebpack::class).first()
+tasks.named<ProcessResources>("jsProcessResources") {
+ val webpack = project.tasks.withType(KotlinWebpack::class).first()
- val bundleFile = webpack.outputFileName
- val publicPath = "./" // TODO get public path from webpack config
+ val bundleFile = webpack.outputFileName
+ val publicPath = "./" // TODO get public path from webpack config
- filesMatching("*.html") {
- expand("bundle" to bundleFile, "publicPath" to publicPath)
- }
+ filesMatching("*.html") {
+ expand("bundle" to bundleFile, "publicPath" to publicPath)
}
}
bgstack15