Skip to content

Commit

Permalink
build: Introduce gradle version catalog (#5683)
Browse files Browse the repository at this point in the history
This is the first step in modernizing our gradle dependency management
by using a [gradle version
catalog](https://docs.gradle.org/8.8/userguide/platforms.html#sub:central-declaration-of-dependencies);
this PR migrates all of our bespoke `Classpaths.groovy` versions into a
standardized `libs.versions.toml`.

The biggest benefit is that dependabot will be able to submit gradle
dependency version bump PRs. As developers, we should also benefit from
greater standardization (IntelliJ works as you would expect with
autocomplete, click-through, and find usages support).

The learning curve should be relatively small.

The intention is to continue the migration to the version catalog.
Additional dependencies we declare outside of `Classpaths.groovy` should
be relatively straightforward to migrate.

Fixes #5177
  • Loading branch information
devinrsmith authored Jul 3, 2024
1 parent ff09e29 commit 0241ba7
Show file tree
Hide file tree
Showing 117 changed files with 779 additions and 824 deletions.
5 changes: 3 additions & 2 deletions Base/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ dependencies {

api 'io.deephaven:hash:0.1.0'

Classpaths.inheritJUnitClassic(project, 'testImplementation')
Classpaths.inheritJMock(project, 'testImplementation')
testImplementation libs.junit4
testImplementation libs.jmock.junit4
testImplementation libs.jmock.imposters
testImplementation project(":base-test-utils")
}

Expand Down
2 changes: 1 addition & 1 deletion BenchmarkSupport/BenchmarkSupport.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ dependencies {
testRuntimeOnly project(':Numerics')

testRuntimeOnly project(':log-to-slf4j')
Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly')
testRuntimeOnly libs.slf4j.simple
}
8 changes: 4 additions & 4 deletions ClientSupport/ClientSupport.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ dependencies {
implementation depCommonsLang3

testImplementation project(':engine-test-utils')
Classpaths.inheritJUnitClassic(project, 'testImplementation')
Classpaths.inheritJUnitPlatform(project)
Classpaths.inheritAssertJ(project)
testImplementation libs.junit4
testImplementation platform(libs.junit.bom)
testImplementation libs.assertj

testRuntimeOnly project(':log-to-slf4j'),
project(path: ':configs'),
project(path: ':test-configs')
Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly')
testRuntimeOnly libs.slf4j.simple
}
10 changes: 6 additions & 4 deletions Configuration/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ dependencies {
implementation project(':IO')
implementation project(':log-factory')
implementation depCommonsLang3
Classpaths.inheritJUnitClassic(project, 'testImplementation')
Classpaths.inheritJMock(project, 'testImplementation')
testImplementation libs.junit4
testImplementation libs.jmock.junit4
testImplementation libs.jmock.imposters

Classpaths.inheritAutoService(project)
compileOnly libs.autoservice
annotationProcessor libs.autoservice.compiler

testImplementation project(path: ':Base', configuration: 'tests')

testRuntimeOnly project(':log-to-slf4j')
Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly')
testRuntimeOnly libs.slf4j.simple
}

sourceSets {
Expand Down
2 changes: 1 addition & 1 deletion Container/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

dependencies {
Classpaths.inheritJUnitClassic(project, 'testImplementation')
testImplementation libs.junit4
}

spotless {
Expand Down
6 changes: 3 additions & 3 deletions Generators/Generators.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ dependencies {
implementation project(':extensions-parquet-table')
implementation depTrove3

Classpaths.inheritGroovy(project, 'groovy', 'implementation')
Classpaths.inheritGroovy(project, 'groovy-json', 'implementation')
implementation libs.groovy
implementation libs.groovy.json

runtimeOnly project(path: ':configs')
runtimeOnly project(path: ':test-configs')
runtimeOnly project(':extensions-kafka')

runtimeOnly project(':log-to-slf4j')
Classpaths.inheritLogbackClassic(project)
runtimeOnly libs.logback.classic

testRuntimeOnly project(path: ':configs')
testRuntimeOnly project(path: ':test-configs')
Expand Down
5 changes: 3 additions & 2 deletions IO/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ dependencies {
implementation project(':SevenZip')
implementation depCommonsCompress
testImplementation project(path: ':Base', configuration: 'tests')
Classpaths.inheritJUnitClassic(project, 'testImplementation')
Classpaths.inheritJMock(project, 'testImplementation')
testImplementation libs.junit4
testImplementation libs.jmock.junit4
testImplementation libs.jmock.imposters
}

sourceSets {
Expand Down
2 changes: 1 addition & 1 deletion ModelFarm/ModelFarm.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ dependencies {
testRuntimeOnly project(':log-to-slf4j')
testRuntimeOnly project(':configs')
testRuntimeOnly project(':test-configs')
Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly')
testRuntimeOnly libs.slf4j.simple
}
2 changes: 1 addition & 1 deletion Numerics/Numerics.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ dependencies {
testRuntimeOnly project(':log-to-slf4j'),
project(path: ':configs'),
project(path: ':test-configs')
Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly')
testRuntimeOnly libs.slf4j.simple
}
11 changes: 6 additions & 5 deletions Plot/Plot.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ dependencies {
implementation project(':engine-tuple')
implementation project(':log-factory')

Classpaths.inheritGroovy(project, 'groovy', 'api')
Classpaths.inheritGroovy(project, 'groovy-json', 'implementation')
Classpaths.inheritAutoService(project)
api libs.groovy
implementation libs.groovy.json
compileOnly libs.autoservice
annotationProcessor libs.autoservice.compiler

compileOnly 'javax.inject:javax.inject:1'

Classpaths.inheritGuava(project)
implementation libs.guava

testImplementation project(':engine-test-utils')
testImplementation TestTools.projectDependency(project, 'engine-time')
Expand All @@ -33,5 +34,5 @@ dependencies {
testRuntimeOnly project(':Numerics')

testRuntimeOnly project(':log-to-slf4j')
Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly')
testRuntimeOnly libs.slf4j.simple
}
4 changes: 2 additions & 2 deletions Stats/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ dependencies {
testImplementation project(path: ':Base', configuration: 'tests')

testRuntimeOnly project(':log-to-slf4j')
Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly')
Classpaths.inheritJUnitClassic(project, 'testImplementation')
testRuntimeOnly libs.slf4j.simple
testImplementation libs.junit4
}

test {
Expand Down
2 changes: 1 addition & 1 deletion TableLogger/TableLogger.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ dependencies {
runtimeOnly project(path: ':configs')

testRuntimeOnly project(':log-to-slf4j')
Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly')
testRuntimeOnly libs.slf4j.simple
}
10 changes: 5 additions & 5 deletions Util/Util.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ dependencies {
testRuntimeOnly project(path: ':test-configs')

testRuntimeOnly project(':log-to-slf4j')
Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly')
testRuntimeOnly libs.slf4j.simple

Classpaths.inheritJUnitPlatform(project)
testImplementation project(':base-test-utils')
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testImplementation platform(libs.junit.bom)
testImplementation libs.junit.jupiter
testRuntimeOnly libs.junit.jupiter.engine
testRuntimeOnly libs.junit.platform.launcher
}
12 changes: 6 additions & 6 deletions Util/channel/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ dependencies {
implementation project(':Util')

// For CountingInputStream
Classpaths.inheritGuava(project)
implementation libs.guava

compileOnly depAnnotations

Classpaths.inheritJUnitPlatform(project)
Classpaths.inheritAssertJ(project)
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testImplementation libs.assertj
testImplementation platform(libs.junit.bom)
testImplementation libs.junit.jupiter
testRuntimeOnly libs.junit.jupiter.engine
testRuntimeOnly libs.junit.platform.launcher
}

test {
Expand Down
10 changes: 5 additions & 5 deletions Util/function/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ dependencies {

compileOnly depAnnotations

Classpaths.inheritJUnitPlatform(project)
Classpaths.inheritAssertJ(project)
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testImplementation libs.assertj
testImplementation platform(libs.junit.bom)
testImplementation libs.junit.jupiter
testRuntimeOnly libs.junit.jupiter.engine
testRuntimeOnly libs.junit.platform.launcher
}

test {
Expand Down
11 changes: 6 additions & 5 deletions application-mode/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@ plugins {
dependencies {
implementation project(':Integrations')

Classpaths.inheritImmutables(project)
compileOnly project(':util-immutables')
annotationProcessor libs.immutables

// we'll rely on the engine-table module to provide the necessary groovy dependencies
Classpaths.inheritGroovy(project, 'groovy', 'compileOnly')
compileOnly libs.groovy

api project(':proto:proto-backplane-grpc')

implementation project(':Configuration')

Classpaths.inheritJUnitPlatform(project)
Classpaths.inheritAssertJ(project)
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation libs.assertj
testImplementation platform(libs.junit.bom)
testImplementation libs.junit.jupiter
}

test {
Expand Down
2 changes: 1 addition & 1 deletion authentication/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ dependencies {
implementation project(':log-factory')
implementation project(':Configuration')

Classpaths.inheritArrow(project, 'flight-core', 'implementation')
implementation libs.arrow.flight.core
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies {
}

pwGen project(':log-to-stream')
Classpaths.inheritLogbackClassic(project, 'pwGen')
pwGen libs.logback.classic
}

shadowJar {
Expand Down
4 changes: 2 additions & 2 deletions authorization-codegen/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ description 'Deephaven Authorization Code Generator'
dependencies {
implementation project(':engine-api')

Classpaths.inheritGrpcPlatform(project, 'implementation')
implementation 'io.grpc:grpc-services'
implementation platform(libs.grpc.bom)
implementation libs.grpc.services

implementation 'com.squareup:javapoet:1.13.0'
}
6 changes: 3 additions & 3 deletions authorization/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ dependencies {
api project(':engine-api')
api project(':proto:proto-backplane-grpc')

Classpaths.inheritGrpcPlatform(project, 'api')
api 'io.grpc:grpc-services'
Classpaths.inheritArrow(project, 'flight-core', 'api')
api platform(libs.grpc.bom)
api libs.grpc.services
api libs.arrow.flight.core

implementation project(':log-factory')
}
5 changes: 3 additions & 2 deletions base-test-utils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dependencies {

api 'io.deephaven:hash:0.1.0'

Classpaths.inheritJUnitClassic(project, 'api')
Classpaths.inheritJMock(project, 'api')
api libs.junit4
api libs.jmock.junit4
api libs.jmock.imposters
}
Loading

0 comments on commit 0241ba7

Please sign in to comment.