Skip to content

Commit 4483e17

Browse files
authored
Move to Kotlin 1.9.23 and clean up build and source files (#19)
1 parent 840937c commit 4483e17

File tree

17 files changed

+716
-1501
lines changed

17 files changed

+716
-1501
lines changed

.yarnrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--ignore-engines true

build.gradle.kts

Lines changed: 26 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
1-
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
2-
import org.jetbrains.kotlin.konan.target.Family.ANDROID
3-
import org.jetbrains.kotlin.konan.target.Family.LINUX
4-
import org.jetbrains.kotlin.konan.target.Family.MINGW
5-
6-
buildscript {
7-
dependencies {
8-
classpath("com.vanniktech:gradle-maven-publish-plugin:0.25.3")
9-
}
10-
}
1+
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
2+
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
3+
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
114

125
plugins {
13-
kotlin("multiplatform")
14-
}
15-
16-
repositories {
17-
mavenCentral()
18-
google()
6+
alias(libs.plugins.kotlin.multiplatform)
7+
alias(libs.plugins.mavenPublish)
198
}
209

2110
val GROUP: String by project
@@ -25,7 +14,10 @@ group = GROUP
2514
version = VERSION_NAME
2615

2716
kotlin {
28-
targetHierarchy.default()
17+
@OptIn(ExperimentalKotlinGradlePluginApi::class)
18+
compilerOptions {
19+
freeCompilerArgs.add("-Xexpect-actual-classes")
20+
}
2921
macosX64()
3022
iosX64()
3123
iosArm64()
@@ -55,73 +47,29 @@ kotlin {
5547
browser()
5648
nodejs()
5749
}
58-
wasm {
50+
@OptIn(ExperimentalWasmDsl::class)
51+
wasmJs {
5952
browser()
60-
binaries.executable()
53+
nodejs()
6154
}
6255

63-
sourceSets {
64-
val commonMain by getting
65-
val commonTest by getting {
66-
dependencies {
67-
implementation(kotlin("test"))
56+
@Suppress("OPT_IN_USAGE")
57+
applyDefaultHierarchyTemplate {
58+
common {
59+
group("jsAndWasmJs") {
60+
withJs()
61+
withWasm()
6862
}
6963
}
64+
}
7065

71-
val jsWasmMain by creating {
72-
dependsOn(commonMain)
73-
}
74-
val jsWasmTest by creating {
75-
dependsOn(commonTest)
76-
}
77-
val jsMain by getting {
78-
dependsOn(jsWasmMain)
79-
}
80-
val jsTest by getting {
81-
dependsOn(jsWasmTest)
82-
}
83-
val wasmMain by getting {
84-
dependsOn(jsWasmMain)
85-
}
86-
val wasmTest by getting {
87-
dependsOn(jsWasmTest)
88-
}
89-
90-
val nativeCommonMain by creating {
91-
dependsOn(commonMain)
92-
}
93-
val nativeCommonTest by creating {
94-
dependsOn(commonTest)
95-
}
96-
97-
val nativeDarwinMain by creating {
98-
dependsOn(nativeCommonMain)
99-
}
100-
val nativeLinuxMain by creating {
101-
dependsOn(nativeCommonMain)
102-
}
103-
val mingwMain by getting {
104-
dependsOn(nativeCommonMain)
105-
}
106-
107-
targets.withType<KotlinNativeTarget>().all {
108-
val mainSourceSet = compilations.getByName("main").defaultSourceSet
109-
val testSourceSet = compilations.getByName("test").defaultSourceSet
110-
111-
mainSourceSet.dependsOn(nativeCommonMain)
112-
testSourceSet.dependsOn(nativeCommonTest)
113-
114-
when {
115-
konanTarget.family == MINGW -> mainSourceSet.dependsOn(mingwMain)
116-
konanTarget.family == LINUX || konanTarget.family == ANDROID -> mainSourceSet.dependsOn(
117-
nativeLinuxMain
118-
)
119-
120-
konanTarget.family.isAppleFamily -> mainSourceSet.dependsOn(nativeDarwinMain)
121-
else -> mainSourceSet.dependsOn(nativeCommonMain)
122-
}
123-
}
66+
sourceSets.commonTest.dependencies {
67+
implementation(kotlin("test"))
12468
}
12569
}
12670

127-
apply(plugin = "com.vanniktech.maven.publish")
71+
// https://github.com/Kotlin/kotlin-wasm-examples/commit/701a051d6ee869abcabebff702b3ccd98d51c38d
72+
rootProject.the<NodeJsRootExtension>().apply {
73+
nodeVersion = "21.0.0-v8-canary202309143a48826a08"
74+
nodeDownloadBaseUrl = "https://nodejs.org/download/v8-canary"
75+
}

gradle.properties

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ SONATYPE_HOST=DEFAULT
1818
RELEASE_SIGNING_ENABLED=true
1919

2020
GROUP=co.touchlab
21-
VERSION_NAME=0.6.11
22-
KOTLIN_VERSION=1.9.10
21+
VERSION_NAME=0.6.12
2322

2423
POM_ARTIFACT_ID=testhelp
2524

@@ -37,6 +36,4 @@ POM_LICENCE_DIST=repo
3736
POM_DEVELOPER_ID=kpgalligan
3837
POM_DEVELOPER_NAME=Kevin Galligan
3938
POM_DEVELOPER_ORG=Touchlab
40-
POM_DEVELOPER_URL=https://touchlab.co/
41-
42-
kotlin.js.ir.output.granularity=whole-program
39+
POM_DEVELOPER_URL=https://touchlab.co/

gradle/libs.versions.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[versions]
2+
3+
mavenPublish = "0.27.0"
4+
kotlin = "1.9.23"
5+
6+
[libraries]
7+
8+
9+
[plugins]
10+
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
11+
mavenPublish = { id = "com.vanniktech.maven.publish", version.ref = "mavenPublish" }
12+
13+
[bundles]
14+

gradle/wrapper/gradle-wrapper.jar

8.83 KB
Binary file not shown.
Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,7 @@
1-
#
2-
# Copyright (C) 2018 Touchlab, Inc.
3-
#
4-
# Licensed under the Apache License, Version 2.0 (the "License");
5-
# you may not use this file except in compliance with the License.
6-
# You may obtain a copy of the License at
7-
#
8-
# http://www.apache.org/licenses/LICENSE-2.0
9-
#
10-
# Unless required by applicable law or agreed to in writing, software
11-
# distributed under the License is distributed on an "AS IS" BASIS,
12-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
# See the License for the specific language governing permissions and
14-
# limitations under the License.
15-
#
16-
171
distributionBase=GRADLE_USER_HOME
182
distributionPath=wrapper/dists
19-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
206
zipStoreBase=GRADLE_USER_HOME
21-
zipStorePath=wrapper/dists
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)