From bbd71db6307b89dac175583b4ff447f4a2b23160 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Sun, 25 Feb 2024 23:02:44 +0100 Subject: [PATCH] build(Gradle): Simplify the declaration of detekt plugins Signed-off-by: Sebastian Schuberth --- buildSrc/src/main/kotlin/ort-kotlin-conventions.gradle.kts | 6 ++---- gradle/libs.versions.toml | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/buildSrc/src/main/kotlin/ort-kotlin-conventions.gradle.kts b/buildSrc/src/main/kotlin/ort-kotlin-conventions.gradle.kts index 99a7ba2426649..59f51b87ce882 100644 --- a/buildSrc/src/main/kotlin/ort-kotlin-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/ort-kotlin-conventions.gradle.kts @@ -92,12 +92,10 @@ configurations.all { } } -// Note: Kotlin DSL cannot directly access configurations that are created by applying a plugin in the very same -// project, thus put configuration names in quotes to leverage lazy lookup. dependencies { - "detektPlugins"(project(":detekt-rules")) + detektPlugins(project(":detekt-rules")) - "detektPlugins"("io.gitlab.arturbosch.detekt:detekt-formatting:${libs.versions.detektPlugin.get()}") + detektPlugins(libs.plugin.detekt.formatting) implementation(libs.log4j.api.kotlin) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 07e7bf11bbbd4..36ba8c81b186e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -75,6 +75,7 @@ versions = { id = "com.github.ben-manes.versions", version.ref = "versionsPlugin [libraries] # These are Maven coordinates for Gradle plugins, which is necessary to use them in precompiled plugin scripts. plugin-detekt = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin", version.ref = "detektPlugin" } +plugin-detekt-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detektPlugin" } plugin-dokkatoo = { module = "dev.adamko.dokkatoo:dokkatoo-plugin", version.ref = "dokkatooPlugin" } plugin-graalVmNativeImage = { module = "org.graalvm.buildtools:native-gradle-plugin", version.ref = "graalVmNativeImagePlugin" } plugin-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlinPlugin" }