我必须从 processResources gradle 任务中排除 xsl 和 xsd 类型的文件。目前我只排除了 xsl 文件和我的 build.gradle 片段,如下所示:
processResources {
filesNotMatching("**/*.xsl") {
expand(project.properties)
}
dependsOn versionInfo
}
我还想通过包含生成的类所属的包的模式来排除扩展名为 xsd 的文件。我已经了解到 filesNotMatching 函数不接受多个参数。这样做的替代方法是什么?
最佳答案
filesNotMatching
可以拍String
模式或 Iterable<String>
.这意味着代码可以是:
processResources {
filesNotMatching(["**/*.xsl", "**/*.xsd"]) {
expand(project.properties)
}
dependsOn versionInfo
}
关于gradle - 如何从 processResources Gradle 任务中排除多个文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51871183/