From 307df635f12c3118a6e16551da0d4c712e28d3ba Mon Sep 17 00:00:00 2001 From: Edwin Jakobs Date: Wed, 11 Oct 2023 17:11:01 +0200 Subject: [PATCH] Fix running programs from jvmDemo with Kotlin 1.9.10 plugin --- .../extra/convention/kotlin-multiplatform.gradle.kts | 11 ++++++++++- gradle.properties | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-multiplatform.gradle.kts b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-multiplatform.gradle.kts index 66ff570b..baa7d26c 100644 --- a/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-multiplatform.gradle.kts +++ b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-multiplatform.gradle.kts @@ -165,4 +165,13 @@ if (shouldPublish) { setRequired({ isReleaseVersion && gradle.taskGraph.hasTask("publish") }) sign(publishing.publications) } -} \ No newline at end of file +} + +kotlin { + jvm().mainRun { + classpath(kotlin.jvm().compilations.getByName("demo").output.allOutputs) + classpath(kotlin.jvm().compilations.getByName("demo").configurations.runtimeDependencyConfiguration!!) + } +} + +tasks.withType().matching { it.name == "jvmRun" }.configureEach { workingDir = rootDir } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index c12fd848..3432648a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,4 +10,5 @@ org.gradle.parallel=true org.gradle.caching=true # Whether to automatically bundle the Kotlin standard library (true by default) # https://kotlinlang.org/docs/gradle.html#dependency-on-the-standard-library -kotlin.stdlib.default.dependency=true \ No newline at end of file +kotlin.stdlib.default.dependency=true +kotlin.mpp.import.legacyTestSourceSetDetection=true \ No newline at end of file