mirror of https://github.com/apache/kafka.git
KAFKA-2797: Only run rat when in the .git repository since it require s the .gitignore to generate the list of files to ignore
Author: Ewen Cheslack-Postava <me@ewencp.org> Reviewers: Gwen Shapira Closes #485 from ewencp/kafka-2797-disable-rat-when-git-missing
This commit is contained in:
parent
590a4616a1
commit
fe11488a77
34
build.gradle
34
build.gradle
|
|
@ -60,23 +60,25 @@ ext {
|
|||
|
||||
apply from: file('wrapper.gradle')
|
||||
apply from: file('scala.gradle')
|
||||
apply from: file('gradle/rat.gradle')
|
||||
|
||||
rat {
|
||||
// Exclude everything under the directory that git should be ignoring via .gitignore or that isn't checked in. These
|
||||
// restrict us only to files that are checked in or are staged.
|
||||
def repo = Grgit.open(project.file('.'))
|
||||
excludes = new ArrayList<String>(repo.clean(ignore: false, directories: true, dryRun: true))
|
||||
// And some of the files that we have checked in should also be excluded from this check
|
||||
excludes.addAll([
|
||||
'**/.git/**',
|
||||
'**/build/**',
|
||||
'CONTRIBUTING.md',
|
||||
'gradlew',
|
||||
'gradlew.bat',
|
||||
'**/README.md',
|
||||
'.reviewboardrc'
|
||||
])
|
||||
if (new File('.git').exists()) {
|
||||
apply from: file('gradle/rat.gradle')
|
||||
rat {
|
||||
// Exclude everything under the directory that git should be ignoring via .gitignore or that isn't checked in. These
|
||||
// restrict us only to files that are checked in or are staged.
|
||||
def repo = Grgit.open(project.file('.'))
|
||||
excludes = new ArrayList<String>(repo.clean(ignore: false, directories: true, dryRun: true))
|
||||
// And some of the files that we have checked in should also be excluded from this check
|
||||
excludes.addAll([
|
||||
'**/.git/**',
|
||||
'**/build/**',
|
||||
'CONTRIBUTING.md',
|
||||
'gradlew',
|
||||
'gradlew.bat',
|
||||
'**/README.md',
|
||||
'.reviewboardrc'
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
subprojects {
|
||||
|
|
|
|||
Loading…
Reference in New Issue