Skip to content

Commit

Permalink
Merge pull request #1 from lukecwik/pr5002
Browse files Browse the repository at this point in the history
[BEAM-3993] Remove duplicate definitions between .gitignore and build.gradle
  • Loading branch information
rmannibucau authored Apr 4, 2018
2 parents b97ccd1 + 57c200e commit 57b15ca
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 73 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# Ignore files generated by the Gradle build process.
**/.gradle/**/*
**/.gogradle/**/*
**/gogradle.lock
**/build/**/*
**/vendor/**/*
**/.gradletasknamecache
Expand All @@ -22,7 +23,9 @@ sdks/java/maven-archetypes/examples/src/main/resources/archetype-resources/src/
sdks/java/maven-archetypes/examples-java8/src/main/resources/archetype-resources/src/

# Ignore files generated by the Python build process.
**/*.py[cod]
**/*.pyc
**/*.pyo
**/*.pyd
**/*.egg-info/
**/.eggs/
**/nose-*.egg/
Expand Down
80 changes: 8 additions & 72 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,71 +68,8 @@ apply plugin: "base"
// Apply one top level rat plugin to perform any required license enforcement analysis
apply plugin: "org.nosphere.apache.rat"

def findIgnoresForRat = {
rat {
def exclusions = [
// Ignore any offline repositories the user may have created.
"**/${offlineRepositoryRoot}/**/*",

// Exclude files generated by the Gradle build process
"**/.gradle/**/*",
"**/.gogradle/**/*",
"**/gogradle.lock",
"**/build/**/*",
"**/vendor/**/*",
"**/.gradletasknamecache",

// .gitignore: Ignore files generated by the Maven build process
"**/target/**/*",
"**/bin/**/*",
"**/dependency-reduced-pom.xml",

// .gitignore: Ignore files generated by the Python build process
"**/*.pyc",
"**/*.pyo",
"**/*.pyd",
"**/*.egg-info/**/*",
"**/.eggs/**/*",
"**/nose-*.egg/**/*",
"**/.tox/**/*",
"**/dist/**/*",
"**/distribute-*/**/*",
"**/env/**/*",
"sdks/python/**/*.c",
"sdks/python/**/*.so",
"sdks/python/**/*.egg",
"sdks/python/LICENSE",
"sdks/python/NOTICE",
"sdks/python/README.md",
"sdks/python/apache_beam/portability/api/*pb2*.*",
// .gitignore: Ignore IntelliJ files.
"**/.idea/**/*",
"**/*.iml",
"**/*.ipr",
"**/*.iws",
"**/out/**/*",

// .gitignore: Ignore Eclipse files.
"**/.classpath",
"**/.project",
"**/.factorypath",
"**/.checkstyle",
"**/.fbExcludeFilterFile",
"**/.apt_generated/**/*",
"**/.settings/**/*",

// .gitignore: Ignore Visual Studio Code files.
"**/.vscode/**/*",

// .gitignore: Hotspot VM leaves this log in a non-target directory when java crashes
"**/hs_err_pid*.log",

// .gitignore: Ignore files that end with "~", since they
// are most likely auto-save files produced by a text editor.
"**/*~",

// .gitignore: Ignore MacOSX files.
"**/.DS_Store/**/*",

// Ignore files we track but do not distribute
".github/**/*",

Expand All @@ -142,6 +79,7 @@ def findIgnoresForRat = {
"**/test/**/.placeholder",

// Default eclipse excludes neglect subprojects

// Proto/grpc generated wrappers
"**/apache_beam/portability/api/*_pb2*.py",
"**/go/pkg/beam/**/*.pb.go",
Expand All @@ -153,23 +91,21 @@ def findIgnoresForRat = {
"**/apache_beam/testing/data/vcf/*",
]

// merge with .gitignore as maven plugin does but gradle/ant one doesn't
def gitIgnore = new File(project.rootDir, '.gitignore')
// Add .gitignore excludes to the Apache Rat exclusion list. We re-create the behavior
// of the Apache Maven Rat plugin since the Apache Ant Rat plugin doesn't do this
// automatically.
def gitIgnore = project(':').file('.gitignore')
if (gitIgnore.exists()) {
def gitIgnoreExcludes = gitIgnore.readLines().findAll { !it.isEmpty() && !it.startsWith('#') }
logger.info('Adding {} gitignores exclusions to rat', gitIgnoreExcludes.size())
println "Adding ${gitIgnoreExcludes.size()} .gitignore exclusions to Apache Rat"
exclusions.addAll(gitIgnoreExcludes)
}

exclusions
}

rat {
plainOutput = true
xmlOutput = false
htmlOutput = false
failOnError = true
excludes = findIgnoresForRat()
excludes = exclusions
}
check.dependsOn rat

Expand Down

0 comments on commit 57b15ca

Please sign in to comment.