提交 02decfd8 编写于 作者: A Andy Wilkinson 提交者: Sam Brannen

Improve exclusions of checkstyleNoHttp task

This commit adds the following exclusions to the source of the
checkstyleNoHttp tasks for each project in the build and for buildSrc:

- bin/ directory (created by Eclipse Buildship)
- .settings directory (created by Eclipse)
- .classpath file (created by Eclipse)
- .project file (created by Eclipse)

An exclusion for the build/ directory is also configured as the
NoHttp plugin does not exclude it by default for buildSrc.

Closes gh-23702
上级 1aa0ea02
......@@ -406,11 +406,15 @@ configure(rootProject) {
nohttp {
source.exclude "**/test-output/**"
whitelistFile = project.file("src/nohttp/whitelist.lines")
def projectDirURI = project.projectDir.toURI()
allprojects.forEach { p ->
def outURI = p.file("out").toURI()
def pattern = projectDirURI.relativize(outURI).path + "**"
source.exclude pattern
def rootPath = file(rootDir).toPath()
def projectDirs = allprojects.collect { it.projectDir } + "${rootDir}/buildSrc"
projectDirs.forEach { dir ->
[ 'bin', 'build', 'out', '.settings' ]
.collect { rootPath.relativize(new File(dir, it).toPath()) }
.forEach { source.exclude "$it/**" }
[ '.classpath', '.project' ]
.collect { rootPath.relativize(new File(dir, it).toPath()) }
.forEach { source.exclude "$it" }
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册