@@ -18,22 +18,11 @@ import java.nio.file.Files
18
18
import java.nio.file.StandardOpenOption
19
19
import java.security.MessageDigest
20
20
21
- buildscript {
22
- repositories {
23
- gradlePluginPortal()
24
- mavenCentral()
25
- }
26
- dependencies {
27
- classpath ' org.ow2.asm:asm:9.7'
28
- classpath ' org.ow2.asm:asm-commons:9.7'
29
- }
30
- }
31
-
32
21
plugins {
33
22
id ' java-library'
34
23
id ' jvm-test-suite'
35
- id ' com.gradleup .shadow' version ' 8.3.1 ' apply false
36
- id ' com.github.ben-manes. versions' version ' 0.51.0 '
24
+ alias(libs . plugins . shadow) . apply( false )
25
+ alias(libs . plugins . versions)
37
26
}
38
27
39
28
defaultTasks ' clean' , ' build'
@@ -54,16 +43,6 @@ def toolchainLauncher = javaToolchains.launcherFor {
54
43
languageVersion = JavaLanguageVersion . of(buildJavaVersion)
55
44
}
56
45
57
- def checkstyleVersion = ' 10.18.0'
58
- def hamcrestVersion = ' 3.0'
59
- def mockitoVersion = ' 5.13.0'
60
- def junitVersion = ' 5.11.0'
61
- def jqwikVersion = ' 1.9.0'
62
- def jsonVersion = ' 20240303'
63
- def jmhVersion = ' 1.37'
64
- def agronaVersion = ' 1.23.0'
65
- def agronaVersionRange = " [${ agronaVersion} ,2.0["
66
-
67
46
def sbeGroup = ' uk.co.real-logic'
68
47
def sbeVersion = file(' version.txt' ). text. trim()
69
48
@@ -193,7 +172,7 @@ subprojects {
193
172
sourceCompatibility = JavaVersion . VERSION_17
194
173
}
195
174
196
- checkstyle. toolVersion = " ${ checkstyleVersion } "
175
+ checkstyle. toolVersion = libs . versions . checkstyle . get()
197
176
198
177
tasks. withType(Sign ). configureEach {
199
178
onlyIf {
@@ -219,7 +198,7 @@ subprojects {
219
198
options. encoding = ' UTF-8'
220
199
options. docEncoding = ' UTF-8'
221
200
options. charSet = ' UTF-8'
222
- options. links(" https://www.javadoc.io/doc/org.agrona/agrona/${ agronaVersion } /" )
201
+ options. links(" https://www.javadoc.io/doc/org.agrona/agrona/${ libs.versions.agrona.get() } /" )
223
202
if (buildJavaVersion >= 23 ) { // early access JavaDoc location is different
224
203
options. links(" https://download.java.net/java/early_access/jdk${ buildJavaVersion} /docs/api/" )
225
204
}
@@ -232,7 +211,7 @@ subprojects {
232
211
testing {
233
212
suites {
234
213
test {
235
- useJUnitJupiter junitVersion
214
+ useJUnitJupiter libs . versions . junit . get()
236
215
237
216
targets {
238
217
all {
@@ -267,12 +246,7 @@ project(':sbe-tool') {
267
246
apply plugin : ' signing'
268
247
269
248
dependencies {
270
- api(" org.agrona:agrona" ) {
271
- version {
272
- strictly(agronaVersionRange)
273
- prefer(agronaVersion)
274
- }
275
- }
249
+ api libs. agrona
276
250
}
277
251
278
252
def generatedDir = " ${ layout.buildDirectory.get()} /generated-src"
@@ -300,26 +274,26 @@ project(':sbe-tool') {
300
274
test {
301
275
dependencies {
302
276
implementation files(" ${ layout.buildDirectory.get()} /classes/java/generated" )
303
- implementation " org .hamcrest:hamcrest: ${ hamcrestVersion } "
304
- implementation " org .mockito:mockito-core: ${ mockitoVersion } "
305
- implementation platform(" org.junit:junit-bom:${ junitVersion } " )
277
+ implementation libs . hamcrest
278
+ implementation libs . mockito
279
+ implementation platform(" org.junit:junit-bom:${ libs.versions.junit.get() } " )
306
280
implementation " org.junit.jupiter:junit-jupiter-params"
307
281
}
308
282
}
309
283
310
284
propertyTest(JvmTestSuite ) {
311
285
// We should be able to use _only_ the JQwik engine, but this issue is outstanding:
312
286
// https://github.com/gradle/gradle/issues/21299
313
- useJUnitJupiter junitVersion
287
+ useJUnitJupiter libs . versions . junit . get()
314
288
315
289
dependencies {
316
290
implementation project()
317
- implementation(" net .jqwik:jqwik: ${ jqwikVersion } " ) {
291
+ implementation(libs . jqwik) {
318
292
// Exclude JUnit 5 dependencies that are already provided due to useJUnitJupiter
319
293
exclude group : ' org.junit.platform' , module : ' junit-platform-commons'
320
294
exclude group : ' org.junit.platform' , module : ' junit-platform-engine'
321
295
}
322
- implementation " org .json:json: ${ jsonVersion } "
296
+ implementation libs . json
323
297
}
324
298
325
299
@@ -611,8 +585,8 @@ project(':sbe-benchmarks') {
611
585
apply plugin : ' com.gradleup.shadow'
612
586
613
587
dependencies {
614
- implementation " org.openjdk. jmh:jmh- core: ${ jmhVersion } "
615
- annotationProcessor " org.openjdk. jmh:jmh- generator- annprocess: ${ jmhVersion } "
588
+ implementation libs . jmh. core
589
+ annotationProcessor libs . jmh. generator. annprocess
616
590
implementation project(' :sbe-tool' )
617
591
implementation files(" ${ layout.buildDirectory.get()} /classes/java/generated" )
618
592
}
0 commit comments