Skip to content

Commit 9e0cc6c

Browse files
authored
chore: migrate from K/JVM to KMP (#244)
Part of #82.
1 parent c769c01 commit 9e0cc6c

File tree

31 files changed

+63
-20
lines changed

31 files changed

+63
-20
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text=auto
2+
*.bat eol=crlf
3+
/gradlew eol=lf

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
.gradle
2-
.idea
3-
build
1+
/.gradle/
2+
/.idea/
3+
/.kotlin/
4+
/build/

build.gradle.kts

Lines changed: 42 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,54 @@
11
plugins {
2-
kotlin("jvm") version "2.1.0"
2+
kotlin("multiplatform") version "2.1.0"
33
kotlin("plugin.serialization") version "2.1.0"
4-
application
4+
id("io.kotest.multiplatform") version "5.9.1"
5+
distribution
56
}
67

7-
repositories {
8-
mavenCentral()
9-
}
10-
11-
dependencies {
12-
implementation("com.charleskorn.kaml:kaml:0.67.0")
138

14-
testImplementation(platform("io.kotest:kotest-bom:5.9.1"))
15-
testImplementation("io.kotest:kotest-runner-junit5")
16-
testImplementation("io.kotest:kotest-assertions-core")
17-
}
189

1910
kotlin {
2011
jvmToolchain(21)
21-
}
12+
jvm {
13+
mainRun {
14+
mainClass = "it.krzeminski.githubactionstyping.MainKt"
15+
}
16+
17+
val test by testRuns.existing {
18+
executionTask {
19+
useJUnitPlatform()
20+
}
21+
}
22+
}
23+
24+
sourceSets {
25+
jvmMain {
26+
dependencies {
27+
implementation("com.charleskorn.kaml:kaml:0.67.0")
28+
}
29+
}
2230

23-
tasks.jar {
24-
manifest.attributes["Main-Class"] = "MainKt"
31+
jvmTest {
32+
dependencies {
33+
runtimeOnly("org.junit.platform:junit-platform-launcher")
34+
implementation(dependencies.platform("io.kotest:kotest-bom:5.9.1"))
35+
runtimeOnly("io.kotest:kotest-runner-junit5")
36+
implementation("io.kotest:kotest-framework-api")
37+
implementation("io.kotest:kotest-assertions-core")
38+
}
39+
}
40+
}
2541
}
2642

27-
tasks.withType<Test>().configureEach {
28-
useJUnitPlatform()
43+
distributions {
44+
main {
45+
contents {
46+
into("lib") {
47+
val jvmJar by tasks.existing
48+
from(jvmJar)
49+
val jvmRuntimeClasspath by configurations
50+
from(jvmRuntimeClasspath)
51+
}
52+
}
53+
}
2954
}

settings.gradle.kts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,15 @@
1+
import org.gradle.api.initialization.resolve.RepositoriesMode.FAIL_ON_PROJECT_REPOS
2+
3+
plugins {
4+
id("org.gradle.toolchains.foojay-resolver-convention") version ("0.9.0")
5+
}
6+
7+
dependencyResolutionManagement {
8+
repositoriesMode = FAIL_ON_PROJECT_REPOS
9+
10+
repositories {
11+
mavenCentral()
12+
}
13+
}
14+
115
rootProject.name = "github-actions-typing"

0 commit comments

Comments
 (0)