I'm converting a DOS batch file to Ant. At the end of the batch file, I print out a list of files copied including size, date and time using the DOS dir
command. I would like to do the same at the end of the Ant script. So far I have:
<!-- LIST COPIED FILES -->
<target name="summary" depends="backup">
<fileset id="zipfiles" dir="${dest}" casesensitive="yes">
<include name="*.zip"/>
</fileset>
<property name="prop.zipfiles" refid="zipfiles"/>
<echo>${prop.zipfiles}</echo>
</target>
How can I modify the above to print each file on a separate line, with size, date and time?
There is a solution based on an external Tasksuite called Ant Flaka. With Ant Flaka you get access to the underlying fileobjects and their properties (name,mtime,size..) from your fileset. no need to open an external process via apply/cmd
output =
I don't think that is available in any of the core Ant tasks.
You could write your own custom task to do this.
Alternatively, you could use the Apply task to execute a system command like
dir
for each file in a fileset. For example:Following your comment below, you could check whether all your zip files were newer than some target file (which you could create before creation of the zips) using the Uptodate task.