Attached is the run log then at the end the actual code.
=============== run log =================================
carlton@laptopdell820:/cjMounts/local/boot/sda3_cjData/cj2009/code/gradle/test1$ gradle -v
------------------------------------------------------------
Gradle 0.7
------------------------------------------------------------
Gradle buildtime: Monday, July 20, 2009 8:50:13 AM CEST
Groovy: 1.6.3
Ant: Apache Ant version 1.7.0 compiled on December 13 2006
Ivy: 2.1.0-rc2
Java: 1.6.0_14
JVM: 14.0-b16
JVM Vendor: Sun Microsystems Inc.
OS Name: Linux
carlton@laptopdell820:/cjMounts/local/boot/sda3_cjData/cj2009/code/gradle/test1$ gradle -q -b bug.gradle checksum
bob.txt Checksum: 12f6bb1941df66b8f138a446d4e8670c
test.txt Checksum: d2038e0920243445bcd882376470d02f
carlton@laptopdell820:/cjMounts/local/boot/sda3_cjData/cj2009/code/gradle/test1$ gradle -q -b bug.gradle length
bob.txt Lenght: 9
test.txt Lenght: 11
carlton@laptopdell820:/cjMounts/local/boot/sda3_cjData/cj2009/code/gradle/test1$ gradle -q -b bug.gradle
bob.txt Checksum: 12f6bb1941df66b8f138a446d4e8670c
test.txt Checksum: d2038e0920243445bcd882376470d02f
bob.txt Lenght: 12f6bb1941df66b8f138a446d4e8670c
test.txt Lenght: d2038e0920243445bcd882376470d02f
carlton@laptopdell820:/cjMounts/local/boot/sda3_cjData/cj2009/code/gradle/test1$
====== code ====================================================
defaultTasks 'checksum', 'length'
task checksum << {
filesList('./antChecksumFiles').each { File file ->
ant.checksum(file: file.canonicalPath, property: file.name)
println "$file.name Checksum: ${ant.antProject.properties[file.name]}"
}
}
task length << {
filesList('./antChecksumFiles').each { File file ->
ant.length(file: file.canonicalPath, property: file.name)
println "$file.name Lenght: ${ant.antProject.properties[file.name]}"
}
}
File[] filesList (String dir) {
File[] files = new File(dir).listFiles()
Arrays.sort(files)
files
}
|