diff --git a/build.gradle.kts b/build.gradle.kts index 7030f14..4f9434a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,12 +5,12 @@ plugins { base `maven-publish` signing - kotlin("jvm") version "2.0.20" apply false - id("org.jlleitschuh.gradle.ktlint") version "12.1.1" apply false - id("io.gitlab.arturbosch.detekt") version "1.23.7" - id("net.researchgate.release") version "3.0.2" - id("se.bjurr.gitchangelog.git-changelog-gradle-plugin") version "2.1.2" - id("org.jetbrains.dokka") version "1.9.20" + alias(libs.plugins.kotlin.jvm) apply false + alias(libs.plugins.ktlint) apply false + alias(libs.plugins.detekt) + alias(libs.plugins.release) + alias(libs.plugins.changelog) + alias(libs.plugins.dokka) } allprojects { @@ -19,16 +19,6 @@ allprojects { repositories { mavenCentral() } - - registerProperties( - "commons-io.version" to "2.17.0", - "jsonassert.version" to "1.5.3", - "assertj.version" to "3.26.3", - "hamcrest.version" to "3.0", - "junit-jupiter.version" to "5.11.1", - "assertk-jvm.version" to "0.28.1", - "wiremock.version" to "3.9.1" - ) } tasks { diff --git a/buildSrc/.gitignore b/buildSrc/.gitignore deleted file mode 100644 index 9666bc4..0000000 --- a/buildSrc/.gitignore +++ /dev/null @@ -1,137 +0,0 @@ - -# Created by https://www.gitignore.io/api/java,kotlin,gradle,intellij+all - -### Intellij+all ### -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - -# User-specific stuff -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/**/usage.statistics.xml -.idea/**/dictionaries -.idea/**/shelf - -# Generated files -.idea/**/contentModel.xml - -# Sensitive or high-churn files -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.local.xml -.idea/**/sqlDataSources.xml -.idea/**/dynamic.xml -.idea/**/uiDesigner.xml -.idea/**/dbnavigator.xml - -# Gradle -.idea/**/gradle.xml -.idea/**/libraries - -# Gradle and Maven with auto-import -# When using Gradle or Maven with auto-import, you should exclude module files, -# since they will be recreated, and may cause churn. Uncomment if using -# auto-import. -# .idea/modules.xml -# .idea/*.iml -# .idea/modules - -# CMake -cmake-build-*/ - -# Mongo Explorer plugin -.idea/**/mongoSettings.xml - -# File-based project format -*.iws - -# IntelliJ -out/ - -# mpeltonen/sbt-idea plugin -.idea_modules/ - -# JIRA plugin -atlassian-ide-plugin.xml - -# Cursive Clojure plugin -.idea/replstate.xml - -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties -fabric.properties - -# Editor-based Rest Client -.idea/httpRequests - -### Intellij+all Patch ### -# Ignores the whole .idea folder and all .iml files -# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360 - -.idea/ - -# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023 - -*.iml -modules.xml -.idea/misc.xml -*.ipr - -### Java ### -# Compiled class file -*.class - -# Log file -*.log - -# BlueJ files -*.ctxt - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* - -### Kotlin ### -# Compiled class file - -# Log file - -# BlueJ files - -# Mobile Tools for Java (J2ME) - -# Package Files # - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml - -### Gradle ### -.gradle -/build/ - -# Ignore Gradle GUI config -gradle-app.setting - -# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) -!gradle-wrapper.jar - -# Cache of project -.gradletasknamecache - -# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 -# gradle/wrapper/gradle-wrapper.properties - - -# End of https://www.gitignore.io/api/java,kotlin,gradle,intellij+all diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts deleted file mode 100644 index a6217e0..0000000 --- a/buildSrc/build.gradle.kts +++ /dev/null @@ -1,7 +0,0 @@ -plugins { - `kotlin-dsl` -} - -repositories { - mavenCentral() -} diff --git a/buildSrc/src/main/kotlin/utils.kt b/buildSrc/src/main/kotlin/utils.kt deleted file mode 100644 index 4039938..0000000 --- a/buildSrc/src/main/kotlin/utils.kt +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright (c) 2019 ekino (https://www.ekino.com/) - */ -import org.gradle.api.Project -import org.gradle.kotlin.dsl.PluginDependenciesSpecScope -import org.gradle.kotlin.dsl.extra - -fun Project.registerProperties(vararg properties: Pair) = mapOf(*properties) - .forEach { - project.extra.set(it.key, it.value) - } - -fun Project.prop(propertyName: String) = project.extra[propertyName] diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..523a2aa --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,33 @@ +[versions] +changelog = "2.1.2" +detekt = "1.23.7" +dokka = "1.9.20" +kotlin = "2.0.20" +ktlint = "12.1.1" +release = "3.0.2" +assertj = "3.26.3" +assertk = "0.28.1" +commons-io = "2.17.0" +hamcrest = "3.0" +jsonassert = "1.5.3" +junit-jupiter = "5.11.1" +kohttp = "0.12.0" +wiremock = "3.9.1" + +[libraries] +assertj-core = { module = "org.assertj:assertj-core", version.ref = "assertj" } +assertk = { module = "com.willowtreeapps.assertk:assertk", version.ref = "assertk" } +commons-io = { module = "commons-io:commons-io", version.ref = "commons-io" } +hamcrest = { module = "org.hamcrest:hamcrest", version.ref = "hamcrest" } +jsonassert = { module = "org.skyscreamer:jsonassert", version.ref = "jsonassert" } +junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit-jupiter" } +kohttp-jackson = { module = "io.github.rybalkinsd:kohttp-jackson", version.ref = "kohttp" } +wiremock = { module = "org.wiremock:wiremock", version.ref = "wiremock" } + +[plugins] +kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } +ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" } +detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" } +release = { id = "net.researchgate.release", version.ref = "release" } +changelog = { id = "se.bjurr.gitchangelog.git-changelog-gradle-plugin", version.ref = "changelog" } +dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } diff --git a/jcv-assertj/build.gradle.kts b/jcv-assertj/build.gradle.kts index 00fdbd1..b125c39 100644 --- a/jcv-assertj/build.gradle.kts +++ b/jcv-assertj/build.gradle.kts @@ -60,16 +60,11 @@ dependencies { implementation(kotlin("stdlib")) api(project(":jcv-core")) - implementation(group = "org.skyscreamer", name = "jsonassert", version = "${prop("jsonassert.version")}") - implementation(group = "org.assertj", name = "assertj-core", version = "${prop("assertj.version")}") + implementation(libs.jsonassert) + implementation(libs.assertj.core) - testImplementation( - group = "org.junit.jupiter", - name = "junit-jupiter", - version = "${prop("junit-jupiter.version")}", - ) - - testImplementation(group = "org.skyscreamer", name = "jsonassert", version = "${prop("jsonassert.version")}") - testImplementation(group = "org.assertj", name = "assertj-core", version = "${prop("assertj.version")}") - testImplementation(group = "commons-io", name = "commons-io", version = "${prop("commons-io.version")}") + testImplementation(libs.junit.jupiter) + testImplementation(libs.jsonassert) + testImplementation(libs.assertj.core) + testImplementation(libs.commons.io) } diff --git a/jcv-core/build.gradle.kts b/jcv-core/build.gradle.kts index 75b1c8d..20461d5 100644 --- a/jcv-core/build.gradle.kts +++ b/jcv-core/build.gradle.kts @@ -59,20 +59,11 @@ publishing { dependencies { implementation(kotlin("stdlib")) implementation(kotlin("reflect")) - implementation(group = "org.skyscreamer", name = "jsonassert", version = "${prop("jsonassert.version")}") + implementation(libs.jsonassert) - testImplementation( - group = "org.junit.jupiter", - name = "junit-jupiter", - version = "${prop("junit-jupiter.version")}", - ) - - testImplementation(group = "org.skyscreamer", name = "jsonassert", version = "${prop("jsonassert.version")}") - testImplementation( - group = "com.willowtreeapps.assertk", - name = "assertk-jvm", - version = "${prop("assertk-jvm.version")}", - ) { + testImplementation(libs.junit.jupiter) + testImplementation(libs.jsonassert) + testImplementation(libs.assertk) { exclude(group = "org.jetbrains.kotlin", module = "kotlin-reflect") } } diff --git a/jcv-hamcrest/build.gradle.kts b/jcv-hamcrest/build.gradle.kts index 4d6762b..12f4e11 100644 --- a/jcv-hamcrest/build.gradle.kts +++ b/jcv-hamcrest/build.gradle.kts @@ -59,16 +59,11 @@ publishing { dependencies { api(project(":jcv-core")) implementation(kotlin("stdlib")) - implementation(group = "org.skyscreamer", name = "jsonassert", version = "${prop("jsonassert.version")}") - implementation(group = "org.hamcrest", name = "hamcrest", version = "${prop("hamcrest.version")}") + implementation(libs.jsonassert) + implementation(libs.hamcrest) - testImplementation( - group = "org.junit.jupiter", - name = "junit-jupiter", - version = "${prop("junit-jupiter.version")}", - ) - - testImplementation(group = "org.skyscreamer", name = "jsonassert", version = "${prop("jsonassert.version")}") - testImplementation(group = "org.hamcrest", name = "hamcrest", version = "${prop("hamcrest.version")}") - testImplementation(group = "commons-io", name = "commons-io", version = "${prop("commons-io.version")}") + testImplementation(libs.junit.jupiter) + testImplementation(libs.jsonassert) + testImplementation(libs.hamcrest) + testImplementation(libs.commons.io) } diff --git a/jcv-wiremock/build.gradle.kts b/jcv-wiremock/build.gradle.kts index 5efd2c9..470cb18 100644 --- a/jcv-wiremock/build.gradle.kts +++ b/jcv-wiremock/build.gradle.kts @@ -59,23 +59,14 @@ publishing { dependencies { api(project(":jcv-core")) implementation(kotlin("stdlib")) - implementation(group = "org.skyscreamer", name = "jsonassert", version = "${prop("jsonassert.version")}") - implementation(group = "org.wiremock", name = "wiremock", version = "${prop("wiremock.version")}") + implementation(libs.jsonassert) + implementation(libs.wiremock) - testImplementation( - group = "org.junit.jupiter", - name = "junit-jupiter", - version = "${prop("junit-jupiter.version")}", - ) - - testImplementation(group = "org.skyscreamer", name = "jsonassert", version = "${prop("jsonassert.version")}") - testImplementation( - group = "com.willowtreeapps.assertk", - name = "assertk-jvm", - version = "${prop("assertk-jvm.version")}", - ) { + testImplementation(libs.junit.jupiter) + testImplementation(libs.jsonassert) + testImplementation(libs.assertk) { exclude(group = "org.jetbrains.kotlin", module = "kotlin-reflect") } - testImplementation(group = "org.wiremock", name = "wiremock", version = "${prop("wiremock.version")}") - testImplementation("io.github.rybalkinsd:kohttp-jackson:0.12.0") + testImplementation(libs.wiremock) + testImplementation(libs.kohttp.jackson) }