Skip to content
代码片段 群组 项目
提交 57c200e3 编辑于 作者: Luke Cwik's avatar Luke Cwik
浏览文件

[BEAM-3993] Remove duplicate definitions between .gitignore and build.gradle

Move rat specific functions into rat closure.
上级 b97ccd10
No related branches found
No related tags found
无相关合并请求
......@@ -8,6 +8,7 @@
# Ignore files generated by the Gradle build process.
**/.gradle/**/*
**/.gogradle/**/*
**/gogradle.lock
**/build/**/*
**/vendor/**/*
**/.gradletasknamecache
......@@ -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/
......
......@@ -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/**/*",
......@@ -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",
......@@ -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
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册