diff options
-rw-r--r-- | runners/gradle-plugin/build.gradle.kts | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/runners/gradle-plugin/build.gradle.kts b/runners/gradle-plugin/build.gradle.kts index f8e519e6..2a61294f 100644 --- a/runners/gradle-plugin/build.gradle.kts +++ b/runners/gradle-plugin/build.gradle.kts @@ -32,13 +32,27 @@ dependencies { // Gradle will put its own version of the stdlib in the classpath, do not pull our own we will end up with // warnings like 'Runtime JAR files in the classpath should have the same version' -configurations.api { - exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib") - exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jdk7") - exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jdk8") - exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-common") +configurations.api.configure { + excludeGradleCommonDependencies() } +/** + * These dependencies will be provided by Gradle, and we should prevent version conflict + * Code taken from the Kotlin Gradle plugin: + * https://github.com/JetBrains/kotlin/blob/70e15b281cb43379068facb82b8e4bcb897a3c4f/buildSrc/src/main/kotlin/GradleCommon.kt#L72 + */ +fun Configuration.excludeGradleCommonDependencies() { + dependencies + .withType<ModuleDependency>() + .configureEach { + exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib") + exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jdk7") + exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jdk8") + exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-common") + exclude(group = "org.jetbrains.kotlin", module = "kotlin-reflect") + exclude(group = "org.jetbrains.kotlin", module = "kotlin-script-runtime") + } +} val sourceJar by tasks.registering(Jar::class) { archiveClassifier.set("sources") |