diff --git a/docs/changes/README.md b/docs/changes/README.md index 6b6ca7ffc..eef391d35 100644 --- a/docs/changes/README.md +++ b/docs/changes/README.md @@ -2,6 +2,10 @@ ## [Unreleased](https://github.com/GradleUp/shadow/compare/9.0.0-beta12...HEAD) - 2025-xx-xx +**Changed** + +- Set `Main-Class` attr for KMP 1.9.0 or above. ([#1410](https://github.com/GradleUp/shadow/pull/1410)) + **Fixed** - Avoid creating jvm targets eagerly for KMP. ([#1378](https://github.com/GradleUp/shadow/pull/1378)) diff --git a/docs/kotlin-plugins/README.md b/docs/kotlin-plugins/README.md index 88c8ac902..ac5f4ff26 100644 --- a/docs/kotlin-plugins/README.md +++ b/docs/kotlin-plugins/README.md @@ -83,7 +83,7 @@ automatically configure additional tasks for bundling the shadowed JAR for its ` kotlin { @Suppress("OPT_IN_USAGE") jvm().mainRun { - // Optionally, set the main class for `runJvm`, it's available from Kotlin 2.1.0 + // Optionally, set the main class for `runJvm`. mainClass = "myapp.MainKt" } sourceSets { @@ -121,7 +121,7 @@ automatically configure additional tasks for bundling the shadowed JAR for its ` kotlin { jvm().mainRun { - // Optionally, set the main class for `runJvm`, it's available from Kotlin 2.1.0 + // Optionally, set the main class for `runJvm`. it.mainClass.set('myapp.MainKt') } sourceSets { diff --git a/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowKmpPlugin.kt b/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowKmpPlugin.kt index 4245ad93d..6413e5f41 100644 --- a/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowKmpPlugin.kt +++ b/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowKmpPlugin.kt @@ -30,7 +30,7 @@ public abstract class ShadowKmpPlugin : Plugin { }, ) - if (!isAtLeastKgpVersion(2, 1, 0)) return@registerShadowJarCommon + if (!isAtLeastKgpVersion(1, 9, 0)) return@registerShadowJarCommon @OptIn(ExperimentalKotlinGradlePluginApi::class) target.mainRun {