Skip to content

Commit

Permalink
Gradle: take version catalog into use
Browse files Browse the repository at this point in the history
  • Loading branch information
mvysny committed Jan 31, 2024
1 parent 4d6288a commit da89866
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 32 deletions.
45 changes: 13 additions & 32 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

val slf4jVersion = "2.0.9"
val testcontainersVersion = "1.19.4" // check latest version at https://repo1.maven.org/maven2/org/testcontainers/testcontainers/

plugins {
kotlin("jvm") version "1.9.22"
`maven-publish`
Expand All @@ -25,43 +22,27 @@ tasks.withType<KotlinCompile> {

dependencies {
api(kotlin("stdlib-jdk8"))
api("com.gitlab.mvysny.jdbiorm:jdbi-orm:2.7")
api(libs.jdbiorm)

// logging
implementation("org.slf4j:slf4j-api:$slf4jVersion")
implementation(libs.slf4j.api)

// validation support
testImplementation("org.hibernate.validator:hibernate-validator:8.0.1.Final") // check latest version at https://repo1.maven.org/maven2/org/hibernate/validator/hibernate-validator/
// EL is required: http://hibernate.org/validator/documentation/getting-started/
testImplementation("org.glassfish:jakarta.el:4.0.2")
testImplementation(libs.bundles.hibernate.validator)

// tests
testImplementation("com.github.mvysny.dynatest:dynatest:0.24")
testImplementation("com.google.code.gson:gson:2.10.1")
testImplementation("org.slf4j:slf4j-simple:$slf4jVersion")
testImplementation("com.h2database:h2:2.2.224")
testImplementation("com.zaxxer:HikariCP:5.0.1")

testImplementation("org.apache.lucene:lucene-analyzers-common:8.11.1") // for H2 Full-Text search
testImplementation("org.apache.lucene:lucene-queryparser:8.11.1") // for H2 Full-Text search

testImplementation("org.postgresql:postgresql:42.5.1")
testImplementation("mysql:mysql-connector-java:8.0.30")
testImplementation("org.mariadb.jdbc:mariadb-java-client:3.0.6")
testImplementation("com.microsoft.sqlserver:mssql-jdbc:11.2.1.jre8")

testImplementation("org.testcontainers:testcontainers:$testcontainersVersion")
testImplementation("org.testcontainers:postgresql:$testcontainersVersion")
testImplementation("org.testcontainers:mysql:$testcontainersVersion")
testImplementation("org.testcontainers:mariadb:$testcontainersVersion")
testImplementation("org.testcontainers:mssqlserver:$testcontainersVersion")
testImplementation("org.testcontainers:cockroachdb:$testcontainersVersion")

// workaround for https://github.com/google/gson/issues/1059
testImplementation("com.fatboyindustrial.gson-javatime-serialisers:gson-javatime-serialisers:1.1.1")
testImplementation(libs.dynatest)
testImplementation(libs.bundles.gson)
testImplementation(libs.slf4j.simple)
testImplementation(libs.h2)
testImplementation(libs.hikaricp)

testImplementation(libs.bundles.lucene) // for H2 Full-Text search
testImplementation(libs.bundles.jdbc)
testImplementation(libs.bundles.testcontainers)

// IDEA language injections
testImplementation("org.jetbrains:annotations:24.0.1")
testImplementation(libs.jetbrains.annotations)
}

java {
Expand Down
42 changes: 42 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[versions]
# https://repo1.maven.org/maven2/org/slf4j/slf4j-api/
slf4j = "2.0.9"
# https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-engine/
junit = "5.9.3"
lucene = "8.11.1"
testcontainers = "1.19.4" # https://testcontainers.com/guides/getting-started-with-testcontainers-for-java

[libraries]
jdbiorm = "com.gitlab.mvysny.jdbiorm:jdbi-orm:2.7"
slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
slf4j-simple = { module = "org.slf4j:slf4j-simple", version.ref = "slf4j" }
jetbrains-annotations = "org.jetbrains:annotations:24.0.1"
junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit" }
jdbi3 = "org.jdbi:jdbi3-core:3.43.0"
jakarta-validation = "jakarta.validation:jakarta.validation-api:3.0.2"
jakarta-el = "org.glassfish:jakarta.el:4.0.2"
hibernate-validator = "org.hibernate.validator:hibernate-validator:8.0.1.Final" # check latest version at https://repo1.maven.org/maven2/org/hibernate/validator/hibernate-validator/
dynatest = "com.github.mvysny.dynatest:dynatest:0.24"
gson = "com.google.code.gson:gson:2.10.1"
hikaricp = "com.zaxxer:HikariCP:5.0.1"
gsonjavatime = "com.fatboyindustrial.gson-javatime-serialisers:gson-javatime-serialisers:1.1.2" # workaround for https://github.com/google/gson/issues/1059
h2 = "com.h2database:h2:2.2.224" # https://repo1.maven.org/maven2/com/h2database/h2/
lucene-analyzers = { module = "org.apache.lucene:lucene-analyzers-common", version.ref = "lucene" }
lucene-queryparser = { module = "org.apache.lucene:lucene-queryparser", version.ref = "lucene" }
testcontainers-testcontainers = { module = "org.testcontainers:testcontainers", version.ref = "testcontainers" }
testcontainers-postgresql = { module = "org.testcontainers:postgresql", version.ref = "testcontainers" }
testcontainers-mysql = { module = "org.testcontainers:mysql", version.ref = "testcontainers" }
testcontainers-mariadb = { module = "org.testcontainers:mariadb", version.ref = "testcontainers" }
testcontainers-mssqlserver = { module = "org.testcontainers:mssqlserver", version.ref = "testcontainers" }
testcontainers-cockroachdb = { module = "org.testcontainers:cockroachdb", version.ref = "testcontainers" }
jdbc-postgresql = "org.postgresql:postgresql:42.7.1" # check newest at https://jdbc.postgresql.org/download/
jdbc-mysql = "com.mysql:mysql-connector-j:8.2.0" # https://dev.mysql.com/downloads/connector/j/
jdbc-mariadb = "org.mariadb.jdbc:mariadb-java-client:3.3.1" # https://mariadb.com/kb/en/about-mariadb-connector-j/
jdbc-mssql = "com.microsoft.sqlserver:mssql-jdbc:12.2.0.jre11"

[bundles]
lucene = ["lucene-analyzers", "lucene-queryparser"]
testcontainers = ["testcontainers-testcontainers", "testcontainers-postgresql", "testcontainers-mysql", "testcontainers-mariadb", "testcontainers-mssqlserver", "testcontainers-cockroachdb"]
jdbc = ["jdbc-postgresql", "jdbc-mysql", "jdbc-mariadb", "jdbc-mssql"]
hibernate-validator = ["hibernate-validator", "jakarta-el"] # EL is required: http://hibernate.org/validator/documentation/getting-started/
gson = ["gson", "gsonjavatime"]

0 comments on commit da89866

Please sign in to comment.