Zip sourceset that includes a wildcard is case senstive

In the build script below, the ZIP includes files with a .css extension, but NOT with a .CSS extension.

It is possible to make this case insensitive? I can add include ‘*.CSS’ to get this to copy as expected, but wanted to know if there was a better solution. Setting caseSensitive=false on the Zip task does not have any affect.

sourceSets {

styleSheet {

resources {

srcDirs = [

src/style

]

include ‘**/*.css’

}

} }

task webFrontEndArtifact(type: Zip) {

into(‘style’) { from sourceSets.styleSheet.resources } }

Setting ‘caseSensitive’ on the ‘Zip’ task has no effect because those files are filtered out by the source set itself. You can try using the ‘include()’ method that takes a closure that is passed an instance of ‘FileElementDetails’ to implement a case-insensitive filter.

include {

it.name.toLowerCase().endsWith(’.css’)

}

http://gradle.org/docs/current/javadoc/org/gradle/api/tasks/util/PatternFilterable.html#include(groovy.lang.Closure)