Skip to content

Commit

Permalink
Updated build dependencies and depdency management, and removed unnee…
Browse files Browse the repository at this point in the history
…ded logging dependencies (#22)
  • Loading branch information
chad-moller-target authored Mar 17, 2023
1 parent a6ee4b5 commit 6086621
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
java-version: '11'
distribution: 'temurin'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
java-version: '11'
distribution: 'temurin'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
Expand Down
67 changes: 25 additions & 42 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,63 +3,46 @@ repositories {
mavenCentral()
}

@Suppress("DSL_SCOPE_VIOLATION")
plugins {
kotlin("jvm")
kotlin("jvm") version libs.versions.kotlin.get()
`java-library`
`maven-publish`
signing
id("io.github.gradle-nexus.publish-plugin")
alias(libs.plugins.versions)
alias(libs.plugins.nexusPublishPlugin)
id("java-test-fixtures")
}

group = "com.target"

dependencies {

val kotlinReflectVersion: String by project
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinReflectVersion")

val hikariCPVersion: String by project
implementation("com.zaxxer:HikariCP:$hikariCPVersion")

val logbackVersion: String by project
implementation("ch.qos.logback:logback-classic:$logbackVersion")
val kotlinLoggingVersion: String by project
implementation("io.github.microutils:kotlin-logging-jvm:$kotlinLoggingVersion")
val slf4jVersion: String by project
implementation("org.slf4j:slf4j-api:$slf4jVersion")

val healthMonitorInterfaceVersion: String by project
api("com.target:health-monitor-interface:$healthMonitorInterfaceVersion")

val mockkVersion: String by project
testFixturesApi("io.mockk:mockk:$mockkVersion")

val junitVersion: String by project
testImplementation(kotlin("test-junit5"))
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
val kotestVersion: String by project
testImplementation("io.kotest:kotest-assertions-core:$kotestVersion")
testImplementation("io.kotest:kotest-property:$kotestVersion")
testImplementation("io.kotest:kotest-extensions:$kotestVersion")
testImplementation("io.mockk:mockk:$mockkVersion")
val testContainersVersion: String by project
testImplementation("org.testcontainers:testcontainers:$testContainersVersion")
testImplementation("org.testcontainers:junit-jupiter:$testContainersVersion")

val postgresqlVersion: String by project
testImplementation("org.postgresql:postgresql:$postgresqlVersion")

val h2Version: String by project
testApi("com.h2database:h2:$h2Version")
implementation(libs.kotlinReflect)

implementation(libs.hikariCP)

implementation(libs.kotlinLogging)

api(libs.healthMonitorInterface)

testFixturesApi(libs.mockk)

testImplementation(libs.bundles.testing)

testImplementation(libs.bundles.testContainers)

testImplementation(libs.postgresql)

testApi(libs.h2)
}

val jvmTargetVersion: String by project

tasks {
compileJava { options.release.set(jvmTargetVersion.toInt()) }
compileKotlin { kotlinOptions { jvmTarget = jvmTargetVersion } }
compileTestKotlin { kotlinOptions { jvmTarget = jvmTargetVersion } }
// This line configures the target JVM version. For applications, it's typically the latest LTS version.
// For libraries, it's typically the earliest LTS version.
java { toolchain { languageVersion.set(JavaLanguageVersion.of(jvmTargetVersion)) } }

withType<Test> {
useJUnitPlatform()
Expand Down
17 changes: 0 additions & 17 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,6 @@
version=0.0.1-SNAPSHOT
jvmTargetVersion=11

nexusPublishPluginVersion=1.1.0
kotlinPluginVersion=1.7.10
testContainersVersion=1.17.6
postgresqlVersion=42.5.1

kotlinReflectVersion=1.6.10
hikariCPVersion=5.0.1
logbackVersion=1.4.0
kotlinLoggingVersion=2.1.23
slf4jVersion=2.0.0
healthMonitorInterfaceVersion=1.2.0

junitVersion=5.9.0
kotestVersion=5.4.2
mockkVersion=1.12.7
h2Version=2.1.214

# Properties used by the publishing plugin
projectTitle=Lite For JDBC
projectDescription=Lightweight library to help simplify JDBC database access
Expand Down
48 changes: 48 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[versions]
kotlin = "1.8.10"

kotlinLogging = "3.0.5"

versionsPlugin = "0.46.0"
nexusPublishPlugin = "1.3.0"

hikariCP = "5.0.1"
healthMonitorInterface = "1.2.0"

jupiter = "5.9.2"
kotest = "5.5.5"
mockk = "1.13.4"
testContainers = "1.17.6"
postgresql = "42.5.4"
h2 = "2.1.214"

[libraries]
kotlinLogging = { module = "io.github.microutils:kotlin-logging-jvm", version.ref = "kotlinLogging" }

kotlinReflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }

hikariCP = { module = "com.zaxxer:HikariCP", version.ref = "hikariCP" }
healthMonitorInterface = { module = "com.target:health-monitor-interface", version.ref = "healthMonitorInterface" }

jupiterApi = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "jupiter" }
jupiterEngine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "jupiter" }
jupiterParams = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "jupiter" }
kotestAssertionsCore = { module = "io.kotest:kotest-assertions-core", version.ref = "kotest" }
kotestJunit5= { module = "io.kotest:kotest-runner-junit5", version.ref = "kotest" }
kotestProperty = { module = "io.kotest:kotest-property", version.ref = "kotest" }
kotestAssertionsJson = { module = "io.kotest:kotest-assertions-json", version.ref = "kotest" }
kotestExtensions = { module = "io.kotest:kotest-extensions", version.ref = "kotest" }
mockk = { module = "io.mockk:mockk", version.ref = "mockk" }
testContainers = { module = "org.testcontainers:testcontainers", version.ref = "testContainers" }
testContainersJunit = { module = "org.testcontainers:junit-jupiter", version.ref = "testContainers" }

postgresql = { module = "org.postgresql:postgresql", version.ref = "postgresql" }
h2 = { module = "com.h2database:h2", version.ref = "h2" }

[bundles]
testing = ["jupiterApi", "jupiterEngine", "jupiterParams", "kotestAssertionsCore", "kotestJunit5", "kotestProperty", "kotestAssertionsJson", "kotestExtensions", "mockk"]
testContainers = ["testContainers", "testContainersJunit"]

[plugins]
versions = { id = "com.github.ben-manes.versions", version.ref = "versionsPlugin" }
nexusPublishPlugin = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "nexusPublishPlugin" }
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
9 changes: 0 additions & 9 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
rootProject.name = "lite-for-jdbc"

pluginManagement {
val kotlinPluginVersion: String by settings
val nexusPublishPluginVersion: String by settings
plugins {
kotlin("jvm") version kotlinPluginVersion
id("io.github.gradle-nexus.publish-plugin") version nexusPublishPluginVersion
}
}

0 comments on commit 6086621

Please sign in to comment.