5
votes

Is there a way to delete duplicate files using ant? Specifically, if I have the same file name in two different output directories, I want to delete it from the second directory.

1

1 Answers

10
votes

I think I came up with a solution.

<target name="delete-duplicates">
    <delete>
        <fileset dir="delete-here" includes="**/*">
            <present targetdir="if-present-here" />
        </fileset>
    </delete>
</target>