How to I conditionally filter a file during the "processResources" stage (1.7 warns of a duplicate file)

Is there a way, during the processResources, to only apply the filter to “one” file.

Currently I have the following which works (see below) 1.6 was ok, 1.7-rc1 complains about a duplicate file (because I am effectively copying the file “twice”.

What I want (I assume I want) is to say

[[ during processResources, if the file is called “” then apply the filter. ]]

processResources {
  from("src/main/resources/") {
    filter { String line ->

How do you achieve that ?

In 1.7 you can use pattern based configuration.

Thanks Luke. That was spot on.