mirror of https://github.com/apache/lucene.git
Cherry pick the validateSourcePatterns. Correct exclusion patterns (.gradle and .idea are only at the root project level).
This commit is contained in:
parent
d44e03b8b0
commit
d819a2eec4
|
@ -71,7 +71,7 @@ subprojects {
|
||||||
extensions.each{
|
extensions.each{
|
||||||
include "**/*.${it}"
|
include "**/*.${it}"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't go into child projects (scanned separately).
|
// Don't go into child projects (scanned separately).
|
||||||
childProjects.keySet().each{
|
childProjects.keySet().each{
|
||||||
exclude "${it}/**"
|
exclude "${it}/**"
|
||||||
|
@ -93,6 +93,7 @@ subprojects {
|
||||||
configure(project(':lucene:benchmark')) {
|
configure(project(':lucene:benchmark')) {
|
||||||
project.tasks.withType(ValidateSourcePatternsTask) {
|
project.tasks.withType(ValidateSourcePatternsTask) {
|
||||||
sourceFiles.exclude 'data/**'
|
sourceFiles.exclude 'data/**'
|
||||||
|
|
||||||
// Known .txt offenders.
|
// Known .txt offenders.
|
||||||
sourceFiles.exclude '**/reuters.first20.lines.txt', '**/trecQRels.txt'
|
sourceFiles.exclude '**/reuters.first20.lines.txt', '**/trecQRels.txt'
|
||||||
}
|
}
|
||||||
|
@ -118,23 +119,30 @@ configure(rootProject) {
|
||||||
|
|
||||||
// ourselves :-)
|
// ourselves :-)
|
||||||
exclude 'gradle/validation/validate-source-patterns.gradle'
|
exclude 'gradle/validation/validate-source-patterns.gradle'
|
||||||
|
|
||||||
|
// gradle and idea folders.
|
||||||
|
exclude '.gradle/**'
|
||||||
|
exclude '.idea/**'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
check.dependsOn validateSourcePatterns
|
check.dependsOn validateSourcePatterns
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CacheableTask
|
||||||
class ValidateSourcePatternsTask extends DefaultTask {
|
class ValidateSourcePatternsTask extends DefaultTask {
|
||||||
private ProgressLoggerFactory progressLoggerFactory
|
private ProgressLoggerFactory progressLoggerFactory
|
||||||
|
|
||||||
@InputFiles
|
@InputFiles
|
||||||
|
@PathSensitive(PathSensitivity.RELATIVE)
|
||||||
|
@IgnoreEmptyDirectories
|
||||||
FileTree sourceFiles
|
FileTree sourceFiles
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
ValidateSourcePatternsTask(ProgressLoggerFactory progressLoggerFactory) {
|
ValidateSourcePatternsTask(ProgressLoggerFactory progressLoggerFactory) {
|
||||||
this.progressLoggerFactory = progressLoggerFactory
|
this.progressLoggerFactory = progressLoggerFactory
|
||||||
}
|
}
|
||||||
|
|
||||||
@TaskAction
|
@TaskAction
|
||||||
public void check() {
|
public void check() {
|
||||||
def invalidPatterns = [
|
def invalidPatterns = [
|
||||||
|
|
Loading…
Reference in New Issue