我的项目正在使用spotless插件.我需要忽略generated-resources目录中的java文件.怎么做同样的.
这就是我使用插件的方式.
apply plugin: "com.diffplug.gradle.spotless"
spotless {
lineEndings = 'unix';
java {
eclipseFormatFile "eclipse-java-google-style.xml"
}
}
Run Code Online (Sandbox Code Playgroud)
sourceSets包含generated-resources目录,我不想删除.
您可以为无斑点格式化程序指定允许包含和排除的目标.
我在多项目构建中的顶级build.gradle中使用以下内容,其中所有Java代码都驻留在modules目录下的子目录中:
subprojects {
...
spotless {
java {
target project.fileTree(project.rootDir) {
include '**/*.java'
exclude 'modules/*/generated/**/*.*'
}
googleJavaFormat()
}
}
...
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
912 次 |
| 最近记录: |