Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exclude multiple files from processResources Gradle task

I have to exclude files of type xsl and xsd from the processResources gradle task. Currently i have only excluded the xsl files and my build.gradle snippet for that looks something like the below:

processResources {
filesNotMatching("**/*.xsl") {
    expand(project.properties)
}
dependsOn versionInfo
}

I want to exclude files with extension xsd as well by including the pattern of the package in which the generated classes belong. I have come to understand that the filesNotMatching function does not take multiple arguments. What is the alternative to doing this?

like image 481
Susanna M Avatar asked Feb 06 '26 20:02

Susanna M


1 Answers

filesNotMatching can take a String pattern or an Iterable<String>. That means the code can be:

processResources {
    filesNotMatching(["**/*.xsl", "**/*.xsd"]) {
        expand(project.properties)
    }
    dependsOn versionInfo
}
like image 67
Alex Taylor Avatar answered Feb 12 '26 13:02

Alex Taylor



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!