From d25d413415b2c429febe14fd2c34d06fd02615b5 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Mon, 7 Mar 2022 11:55:08 +0100 Subject: build: Move build dependencies into version catalog This change moves build dependencies used by Gradle into the version catalog to ensure a single location for all dependency versions. --- buildSrc/src/main/kotlin/Libs.kt | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'buildSrc/src/main/kotlin') diff --git a/buildSrc/src/main/kotlin/Libs.kt b/buildSrc/src/main/kotlin/Libs.kt index f538b1ad..6a73e1b9 100644 --- a/buildSrc/src/main/kotlin/Libs.kt +++ b/buildSrc/src/main/kotlin/Libs.kt @@ -26,31 +26,23 @@ import org.gradle.api.JavaVersion import org.gradle.api.Project import org.gradle.api.artifacts.VersionCatalogsExtension import org.gradle.kotlin.dsl.getByType -import kotlin.properties.ReadOnlyProperty /** * This class makes the version catalog accessible for the build scripts until Gradle adds support for it. * * See https://github.com/gradle/gradle/issues/15383 */ -@Suppress("UnstableApiUsage") public class Libs(project: Project) { /** * The version catalog of the project. */ private val versionCatalog = project.extensions.getByType(VersionCatalogsExtension::class).named("libs") - /** - * A delegate for obtaining configuration values from a [Project] instance. - */ - private fun lib(name: String? = null): ReadOnlyProperty = - ReadOnlyProperty { _, property -> get(name ?: property.name) } - /** * Obtain the version for the specified [dependency][name]. */ operator fun get(name: String): String { - val dep = versionCatalog.findDependency(name).get().get() + val dep = versionCatalog.findLibrary(name).get().get() return "${dep.module.group}:${dep.module.name}:${dep.versionConstraint.displayName}" } -- cgit v1.2.3