gradle/gradle — pull request #160 by kylewm (2013-05-26 00:56:14+00:00)
Title: GRADLE-2171: Added DuplicatesStrategy allowing duplicate

files (based on their path) to be included or excluded, by
default for an entire copy operation or on a per-file basis

- duplicatesStrategy field to FileCopyDetails so individual files
can specify their own strategy for handling duplicates

- add duplicatesStrategy field to CopySpec so that an entire copy
spec can specify the default strategy (this can be overridden
for some or all files)

- add CopySpec.matching and .notMatching convenience
methods. These let the user modify a group of FileCopyDetails
simultaneously. Motivated by setting a duplicatesStrategy for
eg, "META-INF/**/*.xml" but is generally useful

- added CopySpec.duplicatesPriority that determines precedence
among CopySpecs when a duplicate file is to be
excluded. Plugins can set a higher duplicatesPriority for some
specs (eg, Jar.manifest and Jar.metaInf), but this property is
not currently user-settable.

--

This addresses {stories 2 and 3](https://github.com/gradle/gradle/blob/master/design-docs/duplicate-entries-in-archives.md) was discussed on the [mailing list here](http://gradle.1045684.n5.nabble.com/Avoid-duplicates-when-creating-a-zip-file-td5711308.html). This PR builds on #158.