From f67c53280c5b92500433677dedb6d25ecda71b2d Mon Sep 17 00:00:00 2001 From: Martin Vysny Date: Tue, 13 Feb 2024 17:31:22 +0200 Subject: [PATCH] gradle: move deps to libs.versions.toml --- build.gradle.kts | 28 +++++++++++++--------------- gradle.properties | 2 -- gradle/libs.versions.toml | 17 +++++++++++++++++ settings.gradle.kts | 7 ------- 4 files changed, 30 insertions(+), 24 deletions(-) delete mode 100644 gradle.properties create mode 100644 gradle/libs.versions.toml delete mode 100644 settings.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts index 9ac44fa..4213d03 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,13 +1,11 @@ +import com.vaadin.gradle.getBooleanProperty import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.jetbrains.kotlin.gradle.tasks.KotlinCompile -val vaadinVersion: String by extra -val karibuDslVersion: String by extra - plugins { kotlin("jvm") version "1.9.22" - id("application") - id("com.vaadin") + application + alias(libs.plugins.vaadin) } defaultTasks("clean", "build") @@ -26,27 +24,27 @@ tasks.withType { dependencies { // Karibu-DSL dependency - implementation("com.github.mvysny.karibudsl:karibu-dsl-v23:$karibuDslVersion") + implementation(libs.karibu.dsl) // Vaadin - implementation("com.vaadin:vaadin-core:$vaadinVersion") { - afterEvaluate { - if (vaadin.productionMode.get()) { - exclude(module = "vaadin-dev") - } + implementation(libs.vaadin.core) { + // https://github.com/vaadin/flow/issues/18572 + if (vaadin.productionMode.map { v -> getBooleanProperty("vaadin.productionMode") ?: v }.get()) { + exclude(module = "vaadin-dev") } } - implementation("com.github.mvysny.vaadin-boot:vaadin-boot:12.2") + implementation(libs.vaadin.boot) // logging // currently we are logging through the SLF4J API to SLF4J-Simple. See src/main/resources/simplelogger.properties file for the logger configuration - implementation("org.slf4j:slf4j-simple:2.0.9") + implementation(libs.slf4j.simple) implementation(kotlin("stdlib-jdk8")) // test support - testImplementation("com.github.mvysny.kaributesting:karibu-testing-v24:2.1.2") - testImplementation("com.github.mvysny.dynatest:dynatest:0.24") + testImplementation(libs.karibu.testing) + testImplementation(libs.dynatest) + testRuntimeOnly(libs.junit.platform.launcher) } tasks.withType { diff --git a/gradle.properties b/gradle.properties deleted file mode 100644 index 5c69a76..0000000 --- a/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -vaadinVersion=24.3.3 -karibuDslVersion=2.1.0 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..0d1df56 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,17 @@ +[versions] +vaadin = "24.3.4" +# https://repo1.maven.org/maven2/org/slf4j/slf4j-api/ +slf4j = "2.0.11" + +[libraries] +slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" } +slf4j-simple = { module = "org.slf4j:slf4j-simple", version.ref = "slf4j" } +vaadin-boot = "com.github.mvysny.vaadin-boot:vaadin-boot:12.2" +vaadin-core = { module = "com.vaadin:vaadin-core", version.ref = "vaadin" } +karibu-testing = "com.github.mvysny.kaributesting:karibu-testing-v24:2.1.2" +karibu-dsl = "com.github.mvysny.karibudsl:karibu-dsl-v23:2.1.2" +junit-platform-launcher = "org.junit.platform:junit-platform-launcher:1.9.3" +dynatest = "com.github.mvysny.dynatest:dynatest:0.24" + +[plugins] +vaadin = { id = "com.vaadin", version.ref = "vaadin" } diff --git a/settings.gradle.kts b/settings.gradle.kts deleted file mode 100644 index d03961a..0000000 --- a/settings.gradle.kts +++ /dev/null @@ -1,7 +0,0 @@ -// workaround for https://github.com/gradle/gradle/issues/9830 -pluginManagement { - val vaadinVersion: String by settings - plugins { - id("com.vaadin") version vaadinVersion - } -}