Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete duplicate files using ant?

Tags:

java

ant

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.

like image 212
Craig P. Motlin Avatar asked Jun 21 '10 20:06

Craig P. Motlin


1 Answers

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>
like image 87
Craig P. Motlin Avatar answered Sep 30 '22 16:09

Craig P. Motlin