build: use gradle version catalogs

This commit keeps all versions in one location, for reference throughout
various build scripts.

https://docs.gradle.org/current/userguide/platforms.html
This commit is contained in:
George Rawlinson committed 2023-03-23 19:55:28 +13:00
1 parent ab7b603310
commit 556ef99d91
3 files changed
+14 -5

No files matched your search

+2 -3
View File
@@ -2,8 +2,7 @@ plugins {
// Facilitates Java compilation
id 'java'
// For formatting source-code
// NOTE: This is the maximum version that will work with JDK 8.
id 'com.diffplug.spotless' version '6.12.0'
alias(libs.plugins.spotless)
}
// Tasks not related to build are split out into their own gradle scripts
@@ -21,7 +20,7 @@ dependencies {
// Ensure gradle is aware of the patched_client.jar dependency
implementation files('patched_client.jar')
// Used to find/populate scripts
implementation group: 'org.reflections', name: 'reflections', version: '0.10.2'
implementation libs.reflections
}
tasks.named('jar') {
+11
View File
@@ -0,0 +1,11 @@
[versions]
spotless = '6.12.0' # maximum version that will work with JDK 8.
google-java-format = '1.7' # maximum version that will work with JDK 8.
reflections = '0.10.2'
[plugins]
spotless = { id = 'com.diffplug.spotless', version.ref = 'spotless' }
google-java-format = { id = 'com.google.googlejavaformat', version.ref = 'google-java-format' }
[libraries]
reflections = { module = 'org.reflections:reflections', version.ref = 'reflections' }
+1 -2
View File
@@ -15,8 +15,7 @@ spotless {
removeUnusedImports()
// Follow the Google Java formatting guide
// ref: https://google.github.io/styleguide/javaguide.html
// NOTE: This is the maximum version that will work with JDK 8.
googleJavaFormat('1.7')
googleJavaFormat("${libs.versions.google.java.format.get()}")
// Fix formatting of type annotations
formatAnnotations()
}