Fix running programs from jvmDemo with Kotlin 1.9.10 plugin

This commit is contained in:
Edwin Jakobs
2023-10-11 17:11:01 +02:00
parent 96a14c10ce
commit 307df635f1
2 changed files with 12 additions and 2 deletions

View File

@@ -166,3 +166,12 @@ if (shouldPublish) {
sign(publishing.publications) sign(publishing.publications)
} }
} }
kotlin {
jvm().mainRun {
classpath(kotlin.jvm().compilations.getByName("demo").output.allOutputs)
classpath(kotlin.jvm().compilations.getByName("demo").configurations.runtimeDependencyConfiguration!!)
}
}
tasks.withType<JavaExec>().matching { it.name == "jvmRun" }.configureEach { workingDir = rootDir }

View File

@@ -11,3 +11,4 @@ org.gradle.caching=true
# Whether to automatically bundle the Kotlin standard library (true by default) # Whether to automatically bundle the Kotlin standard library (true by default)
# https://kotlinlang.org/docs/gradle.html#dependency-on-the-standard-library # https://kotlinlang.org/docs/gradle.html#dependency-on-the-standard-library
kotlin.stdlib.default.dependency=true kotlin.stdlib.default.dependency=true
kotlin.mpp.import.legacyTestSourceSetDetection=true