@@ -18,22 +18,11 @@ import java.nio.file.Files
1818import  java.nio.file.StandardOpenOption 
1919import  java.security.MessageDigest 
2020
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- 
3221plugins  {
3322 id ' java-library' 
3423 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) 
3726}
3827
3928defaultTasks ' clean' ' build' 
@@ -54,16 +43,6 @@ def toolchainLauncher = javaToolchains.launcherFor {
5443 languageVersion =  JavaLanguageVersion . of(buildJavaVersion)
5544}
5645
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} " 
66- 
6746def  sbeGroup =  ' uk.co.real-logic' 
6847def  sbeVersion =  file(' version.txt' . text. trim()
6948
@@ -193,7 +172,7 @@ subprojects {
193172 sourceCompatibility =  JavaVersion . VERSION_17 
194173 }
195174
196-  checkstyle. toolVersion =  " ${ checkstyleVersion } " 
175+  checkstyle. toolVersion =  libs . versions . checkstyle . get() 
197176
198177 tasks. withType(Sign ). configureEach {
199178 onlyIf {
@@ -219,7 +198,7 @@ subprojects {
219198 options. encoding =  ' UTF-8' 
220199 options. docEncoding =  ' UTF-8' 
221200 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() } " 
223202 if  (buildJavaVersion >=  23 ) { //  early access JavaDoc location is different
224203 options. links(" https://download.java.net/java/early_access/jdk${ buildJavaVersion} " 
225204 }
@@ -232,7 +211,7 @@ subprojects {
232211 testing {
233212 suites {
234213 test {
235-  useJUnitJupiter junitVersion 
214+  useJUnitJupiter libs . versions . junit . get() 
236215
237216 targets {
238217 all {
@@ -267,12 +246,7 @@ project(':sbe-tool') {
267246 apply plugin : ' signing' 
268247
269248 dependencies {
270-  api(" org.agrona:agrona" 
271-  version {
272-  strictly(agronaVersionRange)
273-  prefer(agronaVersion)
274-  }
275-  }
249+  api libs. agrona
276250 }
277251
278252 def  generatedDir =  " ${ layout.buildDirectory.get()} " 
@@ -300,26 +274,26 @@ project(':sbe-tool') {
300274 test {
301275 dependencies {
302276 implementation files(" ${ layout.buildDirectory.get()} " 
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() } " 
306280 implementation " org.junit.jupiter:junit-jupiter-params" 
307281 }
308282 }
309283
310284 propertyTest(JvmTestSuite ) {
311285 //  We should be able to use _only_ the JQwik engine, but this issue is outstanding:
312286 //  https://github.com/gradle/gradle/issues/21299
313-  useJUnitJupiter junitVersion 
287+  useJUnitJupiter libs . versions . junit . get() 
314288
315289 dependencies {
316290 implementation project()
317-  implementation(" net .jqwik:jqwik: ${ jqwikVersion } " 
291+  implementation(libs . jqwik) {
318292 //  Exclude JUnit 5 dependencies that are already provided due to useJUnitJupiter
319293 exclude group : ' org.junit.platform' module : ' junit-platform-commons' 
320294 exclude group : ' org.junit.platform' module : ' junit-platform-engine' 
321295 }
322-  implementation " org .json:json: ${ jsonVersion } " 
296+  implementation libs . json
323297 }
324298
325299
@@ -611,8 +585,8 @@ project(':sbe-benchmarks') {
611585 apply plugin : ' com.gradleup.shadow' 
612586
613587 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
616590 implementation project(' :sbe-tool' 
617591 implementation files(" ${ layout.buildDirectory.get()} " 
618592 }
0 commit comments