Skip to content

Commit b6b5d3b

Browse files
committed
upgrade to support java 25 and gradle 9.2.1
1 parent fba3db3 commit b6b5d3b

File tree

1 file changed

+33
-13
lines changed

1 file changed

+33
-13
lines changed

build.gradle

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,41 @@ dependencies {
6161
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: junitVersion
6262
}
6363

64-
/**
65-
* Simplified for Gradle 9: no more exec() from the build script.
66-
* If you actually want the numeric test fixtures, run this once:
67-
*
68-
* mkdir -p testdata
69-
* cd testdata
70-
* git clone https://github.com/nigeltao/parse-number-fxx-test-data.git
71-
*/
72-
tasks.register('downloadTestData') {
64+
def testdataParent = layout.projectDirectory.dir("testdata")
65+
def repoDir = testdataParent.dir("parse-number-fxx-test-data")
66+
67+
tasks.register('prepareTestDataDir') {
68+
description = 'Create testdata/ directory if missing'
7369
doLast {
74-
logger.lifecycle("Skipping automatic download of parse-number-fxx-test-data.")
75-
logger.lifecycle("If needed, run manually:")
76-
logger.lifecycle(" mkdir -p testdata && cd testdata")
77-
logger.lifecycle(" git clone https://github.com/nigeltao/parse-number-fxx-test-data.git")
70+
def parent = testdataParent.asFile
71+
if (!parent.exists()) {
72+
logger.lifecycle("Creating ${parent}")
73+
parent.mkdirs()
74+
}
75+
}
76+
}
77+
78+
tasks.register('downloadTestData', Exec) {
79+
description = 'Clone parse-number-fxx-test-data into testdata/ if missing'
80+
group = 'verification'
81+
dependsOn tasks.named('prepareTestDataDir')
82+
83+
// Run if repo dir missing OR empty (handles half-created directories)
84+
onlyIf {
85+
def d = repoDir.asFile
86+
!d.exists() || (d.isDirectory() && (d.listFiles() == null || d.listFiles().length == 0))
7887
}
88+
89+
workingDir testdataParent.asFile
90+
commandLine 'git', 'clone', 'https://github.com/nigeltao/parse-number-fxx-test-data.git', 'parse-number-fxx-test-data'
91+
92+
doFirst {
93+
logger.lifecycle("Cloning parse-number-fxx-test-data into ${repoDir.asFile}")
94+
}
95+
}
96+
97+
tasks.withType(Test).configureEach {
98+
dependsOn tasks.named('downloadTestData')
7999
}
80100

81101
tasks.register('test256', Test) {

0 commit comments

Comments
 (0)