Skip to content

Commit

Permalink
adopting Gradle Version Catalog in TOML (wip)
Browse files Browse the repository at this point in the history
  • Loading branch information
kszapsza committed Nov 21, 2024
1 parent 8e4f1d2 commit 95504b3
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 41 deletions.
16 changes: 16 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ json2avro = "0.2.14"
junit_jupiter = "5.10.2"
kafka = "2.8.2"
micrometer_metrics = "1.12.5"
node-gradle = "7.0.2"
okhttp = "3.9.1" # TODO: newest version requires subject alternative name in a certificate during host verification current test cert does not have one
publish-plugin = "1.0.0"
spock = "2.4-M4-groovy-4.0"
Expand All @@ -31,7 +32,9 @@ assertj-core = { group = "org.assertj", name = "assertj-core", version.ref = "as
avro = { group = "org.apache.avro", name = "avro", version.ref = "avro" }
curator-client = { group = "org.apache.curator", name = "curator-client", version.ref = "curator" }
curator-recipes = { group = "org.apache.curator", name = "curator-recipes", version.ref = "curator" }
curator-test = { group = "org.apache.curator", name = "curator-test", version.ref = "curator" }
failsafe = { group = "net.jodah", name = "failsafe", version.ref = "failsafe" }
groovy-json = { group = "org.apache.groovy", name = "groovy-json", version.ref = "groovy" }
guava = { group = "com.google.guava", name = "guava", version.ref = "guava" }
jackson-annotations = { group = "com.fasterxml.jackson.core", name = "jackson-annotations", version.ref = "jackson" }
jackson-databind = { group = "com.fasterxml.jackson.core", name = "jackson-databind", version.ref = "jackson" }
Expand All @@ -41,6 +44,9 @@ jersey-bean-validation = { group = "org.glassfish.jersey.ext", name = "jersey-be
jersey-client = { group = "org.glassfish.jersey.core", name = "jersey-client", version.ref = "jersey" }
jersey-hk2 = { group = "org.glassfish.jersey.inject", name = "jersey-hk2", version.ref = "jersey" }
jersey-media-json-jackson = { group = "org.glassfish.jersey.media", name = "jersey-media-json-jackson", version.ref = "jersey" }
jersey-mvc-freemarker = { group = "org.glassfish.jersey.ext", name = "jersey-mvc-freemarker", version.ref = "jersey" }
jetty-alpn-java-client = { group = "org.eclipse.jetty", name = "jetty-alpn-java-client", version.ref = "jetty" }
jetty-http2-client-transport = { group = "org.eclipse.jetty.http2", name = "jetty-http2-client-transport", version.ref = "jetty" }
json2avro-converter = { group = "tech.allegro.schema.json2avro", name = "converter", version.ref = "json2avro" }
junit-vintage-engine = { group = "org.junit.vintage", name = "junit-vintage-engine", version.ref = "junit_jupiter" }
kafka-clients = { group = "org.apache.kafka", name = "kafka-clients", version.ref = "kafka" }
Expand All @@ -51,15 +57,25 @@ okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okhtt
spock-bom = { group = "org.spockframework", name = "spock-bom", version.ref = "spock" }
spock-core = { group = "org.spockframework", name = "spock-core", version.ref = "spock" }
spock-junit4 = { group = "org.spockframework", name = "spock-junit4", version.ref = "spock" }
spock-spring = { group = "org.spockframework", name = "spock-spring", version.ref = "spock" }
spring-boot-configuration-processor = { group = "org.springframework.boot", name = "spring-boot-configuration-processor", version.ref = "spring" }
spring-boot-starter = { group = "org.springframework.boot", name = "spring-boot-starter", version.ref = "spring" }
spring-boot-starter-actuator = { group = "org.springframework.boot", name = "spring-boot-starter-actuator", version.ref = "spring" }
spring-boot-starter-jersey = { group = "org.springframework.boot", name = "spring-boot-starter-jersey", version.ref = "spring" }
spring-boot-starter-test = { group = "org.springframework.boot", name = "spring-boot-starter-test", version.ref = "spring" }
spring-boot-starter-web = { group = "org.springframework.boot", name = "spring-boot-starter-web", version.ref = "spring" }
spring-context = { group = "org.springframework", name = "spring-context", version.ref = "spring_web" }
spring-web = { group = "org.springframework", name = "spring-web", version.ref = "spring_web" }
spring-webflux = { group = "org.springframework", name = "spring-webflux", version.ref = "spring_web" }
testcontainers-kafka = { group = "org.testcontainers", name = "kafka", version.ref = "testcontainers" }
testcontainers-spock = { group = "org.testcontainers", name = "spock", version.ref = "testcontainers" }
undertow-core = { group = "io.undertow", name = "undertow-core", version.ref = "undertow" }
wiremock-standalone = { group = "org.wiremock", name = "wiremock-standalone", version.ref = "wiremock" }

[bundles]

[plugins]
axion-release = { id = "pl.allegro.tech.build.axion-release", version.ref = "axion-release" }
jmh = { id = "me.champeau.jmh", version.ref = "jmh" }
node-gradle = { id = "com.github.node-gradle.node", version.ref = "node-gradle" }
publish-plugin = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "publish-plugin" }
17 changes: 8 additions & 9 deletions hermes-consumers/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ application {
mainClass = "pl.allegro.tech.hermes.consumers.HermesConsumers"
}

val versions = rootProject.extra["versions"] as Map<*, *>
val sbeClasspath: Configuration by configurations.creating

dependencies {
Expand All @@ -16,9 +15,9 @@ dependencies {
implementation(project(":hermes-metrics"))
implementation(project(":hermes-schema"))

api(group = "org.springframework.boot", name = "spring-boot-starter", version = versions["spring"] as String)
api(group = "org.eclipse.jetty", name = "jetty-alpn-java-client", version = versions["jetty"] as String)
api(group = "org.eclipse.jetty.http2", name = "jetty-http2-client-transport", version = versions["jetty"] as String)
api(libs.spring.boot.starter)
api(libs.jetty.alpn.java.client)
api(libs.jetty.http2.client.transport)
implementation(group = "org.jctools", name = "jctools-core", version = "4.0.3")
api(group = "jakarta.jms", name = "jakarta.jms-api", version = "3.1.0")
implementation(group = "joda-time", name = "joda-time", version = "2.12.7")
Expand All @@ -34,17 +33,17 @@ dependencies {
api(group = "org.apache.httpcomponents.core5", name = "httpcore5", version = "5.2.4")

testImplementation(project(":hermes-test-helper"))
testImplementation(group = "org.apache.curator", name = "curator-test", version = versions["curator"] as String)
testImplementation(libs.curator.test)
testImplementation(group = "jakarta.servlet", name = "jakarta.servlet-api", version = "6.0.0")

testImplementation(project(":hermes-common"))

testImplementation(group = "org.awaitility", name = "awaitility-groovy", version = "4.2.1")
testImplementation(group = "tech.allegro.schema.json2avro", name = "converter", version = versions["json2avro"] as String)
testImplementation(libs.json2avro.converter)

testImplementation(group = "org.spockframework", name = "spock-core", version = versions["spock"] as String)
testImplementation(group = "org.spockframework", name = "spock-junit4", version = versions["spock"] as String)
testRuntimeOnly(group = "org.junit.vintage", name = "junit-vintage-engine", version = versions["junit_jupiter"] as String)
testImplementation(libs.spock.core)
testImplementation(libs.spock.junit4)
testRuntimeOnly(libs.junit.vintage.engine)

sbeClasspath(group = "uk.co.real-logic", name = "sbe-all", version = "1.31.1")
}
Expand Down
21 changes: 10 additions & 11 deletions hermes-frontend/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ plugins {
`java-library`
}

val versions = rootProject.extra["versions"] as Map<*, *>

application {
mainClass = "pl.allegro.tech.hermes.frontend.HermesFrontend"
}
Expand All @@ -15,22 +13,23 @@ dependencies {
implementation(project(":hermes-metrics"))
implementation(project(":hermes-schema"))

api(group = "org.springframework.boot", name = "spring-boot-starter", version = versions["spring"] as String)
api(group = "io.undertow", name = "undertow-core", version = versions["undertow"] as String)
api(libs.spring.boot.starter)
api(libs.undertow.core)
// Did not update that as we're trying to abandon buffers
api(group = "net.openhft", name = "chronicle-map", version = "3.25ea6") {
exclude(group = "net.openhft", module = "chronicle-analytics")
}
implementation(group = "commons-io", name = "commons-io", version = "2.16.1")
implementation(group = "net.jodah", name = "failsafe", version = versions["failsafe"] as String)
implementation(libs.failsafe)

testImplementation(project(":hermes-test-helper"))

testImplementation(group = "org.spockframework", name = "spock-core", version = versions["spock"] as String)
testImplementation(group = "org.apache.groovy", name = "groovy-json", version = versions["groovy"] as String)
testImplementation(group = "org.awaitility", name = "awaitility-groovy", version = "4.2.1")
testImplementation(group = "org.awaitility", name = "awaitility", version = "4.2.1")
testImplementation(group = "org.testcontainers", name = "spock", version = versions["testcontainers"] as String)
testImplementation(group = "org.testcontainers", name = "kafka", version = versions["testcontainers"] as String)
testRuntimeOnly(group = "org.junit.vintage", name = "junit-vintage-engine", version = versions["junit_jupiter"] as String)
testImplementation(group = "org.awaitility", name = "awaitility-groovy", version = "4.2.1")
testImplementation(libs.groovy.json)
testImplementation(libs.spock.core)
testImplementation(libs.testcontainers.kafka)
testImplementation(libs.testcontainers.spock)

testRuntimeOnly(libs.junit.vintage.engine)
}
40 changes: 19 additions & 21 deletions hermes-management/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ import com.github.gradle.node.yarn.task.YarnTask
plugins {
`java-library`
application
id("com.github.node-gradle.node") version "7.0.2"
alias(libs.plugins.node.gradle)
}

val versions = rootProject.extra["versions"] as Map<*, *>

application {
mainClass = "pl.allegro.tech.hermes.management.HermesManagement"
}
Expand All @@ -18,17 +16,18 @@ dependencies {
api(project(":hermes-tracker"))
implementation(project(":hermes-schema"))

api(group = "org.springframework.boot", name = "spring-boot-starter-web", version = versions["spring"] as String)
api(group = "org.springframework.boot", name = "spring-boot-starter-actuator", version = versions["spring"] as String)
api(group = "org.springframework.boot", name = "spring-boot-starter-jersey", version = versions["spring"] as String)
api(libs.spring.boot.starter.actuator)
api(libs.spring.boot.starter.jersey)
api(libs.spring.boot.starter.web)

implementation(group = "net.sf.jopt-simple", name = "jopt-simple", version = "5.0.4")
implementation(group = "org.glassfish.jersey.ext", name = "jersey-mvc-freemarker", version = versions["jersey"] as String)
implementation(libs.jersey.mvc.freemarker)

implementation(group = "io.swagger", name = "swagger-jersey2-jaxrs", version = "1.6.14") {
exclude(group = "javax.validation", module = "validation-api")
}

implementation(group = "org.apache.kafka", name = "kafka-clients", version = versions["kafka"] as String)
implementation(libs.kafka.clients)

implementation(group = "commons-codec", name = "commons-codec", version = "1.16.1")
implementation(group = "com.github.java-json-tools", name = "json-schema-validator", version = "2.2.14")
Expand All @@ -38,19 +37,18 @@ dependencies {

api(group = "org.javers", name = "javers-core", version = "7.4.2")

implementation(group = "com.fasterxml.jackson.datatype", name = "jackson-datatype-jsr310", version = versions["jackson"] as String)
implementation(libs.jackson.datatype.jsr310)
implementation(group = "commons-io", name = "commons-io", version = "2.16.1")

testImplementation(project(":hermes-test-helper"))
testImplementation(group = "org.springframework.boot", name = "spring-boot-starter-test", version = versions["spring"] as String)

testImplementation(group = "org.spockframework", name = "spock-core", version = versions["spock"] as String)
testImplementation(group = "org.spockframework", name = "spock-junit4", version = versions["spock"] as String)
testImplementation(group = "org.spockframework", name = "spock-spring", version = versions["spock"] as String)
testImplementation(group = "org.apache.groovy", name = "groovy-json", version = versions["groovy"] as String)

testImplementation(group = "org.testcontainers", name = "spock", version = versions["testcontainers"] as String)
testImplementation(group = "org.testcontainers", name = "kafka", version = versions["testcontainers"] as String)
testImplementation(libs.spring.boot.starter.test)

testImplementation(libs.groovy.json)
testImplementation(libs.spock.core)
testImplementation(libs.spock.junit4)
testImplementation(libs.spock.spring)
testImplementation(libs.testcontainers.kafka)
testImplementation(libs.testcontainers.spock)
}

node {
Expand All @@ -74,9 +72,9 @@ tasks.register<YarnTask>("buildHermesConsole") {
dependsOn("yarn")

val tasksThatDontRequireConsole = listOf(
"integrationTest",
"slowIntegrationTest",
"check"
"integrationTest",
"slowIntegrationTest",
"check"
)

onlyIf {
Expand Down

0 comments on commit 95504b3

Please sign in to comment.