get Ant
Returns the AntBuilder
for this project. You can use this in your build file to execute ant tasks. See example below.
task printChecksum {
doLast {
ant {
//using ant checksum task to store the file checksum in the checksumOut ant property
checksum(property: 'checksumOut', file: 'someFile.txt')
//we can refer to the ant property created by checksum task:
println "The checksum is: " + checksumOut
}
//we can refer to the ant property later as well:
println "I just love to print checksums: " + ant.checksumOut
}
}
Content copied to clipboard
<target name='printChecksum'>
<checksum property='checksumOut'>
<fileset dir='.'>
<include name='agile.txt'/>
</fileset>
</checksum>
<echo>The checksum is: ${checksumOut}</echo>
</target>
Content copied to clipboard
task printChecksum {
doLast {
ant {
checksum(property: 'checksumOut') {
fileset(dir: '.') {
include name: 'agile1.txt'
}
}
}
logger.lifecycle("The checksum is $ant.checksumOut")
}
}
Content copied to clipboard
Return
The AntBuilder
for this project. Never returns null.