Skip to content

Commit 81633af

Browse files
committed
Remove AntBuilder usage from RequireJsTaskTest
- Replace AntBuilder.copy() with Java file I/O operations - Use File.eachFileRecurse for recursive directory copying - Ensures compatibility with Gradle 9 where AntBuilder is deprecated
1 parent 0da8013 commit 81633af

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/test/groovy/com/eriwen/gradle/js/RequireJsTaskTest.groovy

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,20 @@ class RequireJsTaskTest extends Specification {
109109
}
110110

111111
def addJamDir() {
112-
new AntBuilder().copy(todir: new File("${project.projectDir.absolutePath}${File.separator}jam").canonicalPath) {
113-
fileset(dir : new File("src/test/resources/requirejs/jam").canonicalPath)
112+
def sourceDir = new File("src/test/resources/requirejs/jam")
113+
def targetDir = new File("${project.projectDir.absolutePath}${File.separator}jam")
114+
targetDir.mkdirs()
115+
sourceDir.eachFileRecurse { file ->
116+
def relativePath = file.absolutePath.substring(sourceDir.absolutePath.length() + 1)
117+
def targetFile = new File(targetDir, relativePath)
118+
if (file.isFile()) {
119+
targetFile.parentFile.mkdirs()
120+
targetFile.withOutputStream { out ->
121+
file.withInputStream { in ->
122+
out << in
123+
}
124+
}
125+
}
114126
}
115127
}
116128

0 commit comments

Comments
 (0)