Skip to content

Commit

Permalink
chore: Move dependencies to version catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
felipebz committed Jul 16, 2024
1 parent 8f1a824 commit fe44f08
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 59 deletions.
18 changes: 9 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ plugins {
`maven-publish`
signing
jacoco
kotlin("jvm") version "2.0.0"
id("org.jetbrains.dokka") version ("1.9.20")
id("com.github.hierynomus.license") version "0.16.1"
id("org.sonarqube") version "5.0.0.4638"
id("org.jreleaser") version "1.13.1"
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.dokka)
alias(libs.plugins.license)
alias(libs.plugins.sonarqube)
alias(libs.plugins.jreleaser)
}

allprojects {
Expand Down Expand Up @@ -44,9 +44,9 @@ subprojects {

dependencies {
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
testImplementation(Libs.assertj)
testImplementation(Libs.mockito)
testImplementation(Libs.mockito_kotlin)
testImplementation(rootProject.libs.assertj)
testImplementation(rootProject.libs.mockito)
testImplementation(rootProject.libs.mockito.kotlin)
}

configurations {
Expand All @@ -67,7 +67,7 @@ subprojects {
suites {
configureEach {
if (this is JvmTestSuite) {
useJUnitJupiter(Versions.junit)
useJUnitJupiter(rootProject.libs.versions.junit)
}
}
}
Expand Down
28 changes: 0 additions & 28 deletions buildSrc/src/main/kotlin/Dependencies.kt

This file was deleted.

51 changes: 51 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[versions]
kotlin = "2.0.0"
dokka = "1.9.20"
download = "5.6.0"
jreleaser = "1.13.1"
license = "0.16.1"
shadow = "8.1.7"
sonarscanner = "5.0.0.4638"

# libs
flatlaf = "3.4.1"
flr = "1.4.0"
jackson = "2.17.1"
jsoup = "1.17.2"
min-sonarqube = "9.9.0.65466"
min-sonarqubeapi = "9.14.0.375"
woodstox = "6.6.2"

# testing
assertj = "3.25.3"
junit = "5.10.2"
mockito = "5.12.0"
mockito-kotlin = "5.3.1"
sonarqube-orchestrator = "5.0.0.2065"

[libraries]
assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" }
flatlaf = { module = "com.formdev:flatlaf", version.ref = "flatlaf" }
flr-core = { module = "com.felipebz.flr:flr-core", version.ref = "flr" }
flr-testing-harness = { module = "com.felipebz.flr:flr-testing-harness", version.ref = "flr" }
flr-toolkit = { module = "com.felipebz.flr:flr-toolkit", version.ref = "flr" }
flr-xpath = { module = "com.felipebz.flr:flr-xpath", version.ref = "flr" }
jackson = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" }
jackson-xml = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-xml", version.ref = "jackson" }
jsoup = { module = "org.jsoup:jsoup", version.ref = "jsoup" }
mockito = { module = "org.mockito:mockito-core", version.ref = "mockito" }
mockito-kotlin = { module = "org.mockito.kotlin:mockito-kotlin", version.ref = "mockito-kotlin" }
woodstox = { module = "com.fasterxml.woodstox:woodstox-core", version.ref = "woodstox" }
sonar-plugin-api = { module = "org.sonarsource.api.plugin:sonar-plugin-api", version.ref = "min-sonarqubeapi" }
sonar-plugin-api-impl = { module = "org.sonarsource.sonarqube:sonar-plugin-api-impl", version.ref = "min-sonarqube" }
sonar-ws = { module = "org.sonarsource.sonarqube:sonar-ws", version.ref = "min-sonarqube" }
sonar-orchestrator = { module = "org.sonarsource.orchestrator:sonar-orchestrator-junit5", version.ref = "sonarqube-orchestrator" }

[plugins]
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
download = { id = "de.undercouch.download", version.ref = "download" }
jreleaser = { id = "org.jreleaser", version.ref = "jreleaser" }
license = { id = "com.github.hierynomus.license", version.ref = "license" }
shadow = { id = "io.github.goooler.shadow", version.ref = "shadow" }
sonarqube = { id = "org.sonarqube", version.ref = "sonarscanner" }
20 changes: 10 additions & 10 deletions sonar-zpa-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ import java.time.format.DateTimeFormatter
import java.util.*

plugins {
id("io.github.goooler.shadow") version Versions.plugin_shadow
alias(libs.plugins.shadow)
}

dependencies {
implementation(Libs.flr_core)
implementation(Libs.jackson_xml)
implementation(Libs.woodstox)
implementation(libs.flr.core)
implementation(libs.jackson.xml)
implementation(libs.woodstox)
implementation(project(":zpa-core"))
implementation(project(":zpa-checks"))
implementation(project(":zpa-checks-testkit"))
compileOnly("org.sonarsource.api.plugin:sonar-plugin-api:${Versions.min_sonarqube_api}")
testImplementation("org.sonarsource.sonarqube:sonar-plugin-api-impl:${Versions.min_sonarqube}")
compileOnly(libs.sonar.plugin.api)
compileOnly(libs.sonar.plugin.api.impl)
}

testing {
Expand All @@ -27,9 +27,9 @@ testing {
testType.set(TestSuiteType.INTEGRATION_TEST)

dependencies {
implementation(Libs.assertj)
implementation("org.sonarsource.sonarqube:sonar-ws:${Versions.min_sonarqube}")
implementation("org.sonarsource.orchestrator:sonar-orchestrator-junit5:${Versions.sonarqube_orchestrator}")
implementation(libs.assertj)
implementation(libs.sonar.ws)
implementation(libs.sonar.orchestrator)
}

targets {
Expand Down Expand Up @@ -78,7 +78,7 @@ val shadowJar = tasks.named<ShadowJar>("shadowJar") {
"Plugin-OrganizationUrl" to "https://felipezorzo.com.br",
"Plugin-SourcesUrl" to "https://github.com/felipebz/zpa",
"Plugin-Version" to project.version,
"Sonar-Version" to Versions.min_sonarqube,
"Sonar-Version" to libs.versions.min.sonarqube,
"SonarLint-Supported" to "false",
"Plugin-RequiredForLanguages" to "plsqlopen"
))
Expand Down
10 changes: 5 additions & 5 deletions zpa-checks/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import de.undercouch.gradle.tasks.download.Download

plugins {
id("de.undercouch.download") version "5.6.0"
alias(libs.plugins.download)
}

dependencies {
implementation(Libs.flr_core)
implementation(Libs.flr_xpath)
implementation(libs.flr.core)
implementation(libs.flr.xpath)
implementation(project(":zpa-core"))
testImplementation(project(":zpa-checks-testkit"))
}
Expand Down Expand Up @@ -36,9 +36,9 @@ testing {
dependencies {
implementation(layout.projectDirectory.dir("tools/sqlcl/lib").asFileTree)
implementation(project())
implementation(Libs.jackson)
implementation(libs.jackson)
implementation(project(":zpa-core"))
implementation("org.jsoup:jsoup:${Versions.jsoup}")
implementation(libs.jsoup)
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions zpa-core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dependencies {
api(Libs.flr_core)
implementation(Libs.jackson)
testImplementation(Libs.flr_testing_harness)
api(libs.flr.core)
implementation(libs.jackson)
testImplementation(libs.flr.testing.harness)
}

description = "Z PL/SQL Analyzer :: Core"
8 changes: 4 additions & 4 deletions zpa-toolkit/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

plugins {
id("io.github.goooler.shadow") version Versions.plugin_shadow
alias(libs.plugins.shadow)
}

dependencies {
implementation(Libs.flr_xpath)
implementation(Libs.flr_toolkit)
implementation("com.formdev:flatlaf:3.4.1")
implementation(libs.flr.xpath)
implementation(libs.flr.toolkit)
implementation(libs.flatlaf)
implementation(project(":zpa-core"))
}

Expand Down

0 comments on commit fe44f08

Please sign in to comment.