Browse Source

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
pull/23703/head
Andy Wilkinson 7 years ago committed by Sam Brannen
parent
commit
02decfd864
  1. 14
      build.gradle

14
build.gradle

@ -406,11 +406,15 @@ configure(rootProject) {
nohttp { nohttp {
source.exclude "**/test-output/**" source.exclude "**/test-output/**"
whitelistFile = project.file("src/nohttp/whitelist.lines") whitelistFile = project.file("src/nohttp/whitelist.lines")
def projectDirURI = project.projectDir.toURI() def rootPath = file(rootDir).toPath()
allprojects.forEach { p -> def projectDirs = allprojects.collect { it.projectDir } + "${rootDir}/buildSrc"
def outURI = p.file("out").toURI() projectDirs.forEach { dir ->
def pattern = projectDirURI.relativize(outURI).path + "**" [ 'bin', 'build', 'out', '.settings' ]
source.exclude pattern .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" }
} }
} }

Loading…
Cancel
Save