I\'m trying to copy the newest file from a directory using Ant, ideally I\'d like to have a filter on the filename too (eg: \'*file.java\'), but I don\'t have any idea of ho
Answer was:
<target name="init">
<copy todir="." flatten="true">
<last>
<sort>
<date xmlns="antlib:org.apache.tools.ant.types.resources.comparators"/>
<resources>
<fileset dir="/path/to/files/">
<include name="*sdk*" />
</fileset>
</resources>
</sort>
</last>
</copy>
</target>
edit: changed first to last and added filter