aboutsummaryrefslogtreecommitdiff
path: root/runners/gradle-plugin
diff options
context:
space:
mode:
authorMartin Bonnin <martin@mbonnin.net>2022-07-18 14:41:22 +0200
committerGitHub <noreply@github.com>2022-07-18 14:41:22 +0200
commitb6a8e58832929cd08d7fcd9f92e7fd010990f5e0 (patch)
treeca767f0723ec54885da559284e86e4900076b342 /runners/gradle-plugin
parent7cbdcc9ae62d03af5efbab8f5ce2d815f456513a (diff)
downloaddokka-b6a8e58832929cd08d7fcd9f92e7fd010990f5e0.tar.gz
dokka-b6a8e58832929cd08d7fcd9f92e7fd010990f5e0.tar.bz2
dokka-b6a8e58832929cd08d7fcd9f92e7fd010990f5e0.zip
Remove kotlin-stdlib dependency from gradle runner (#2570)
Diffstat (limited to 'runners/gradle-plugin')
-rw-r--r--runners/gradle-plugin/build.gradle.kts24
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")