[ 
https://issues.apache.org/jira/browse/BEAM-3993?focusedWorklogId=87585&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-87585
 ]

ASF GitHub Bot logged work on BEAM-3993:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 04/Apr/18 15:19
            Start Date: 04/Apr/18 15:19
    Worklog Time Spent: 10m 
      Work Description: lukecwik closed pull request #5002: [BEAM-3993] read 
gitignore and add it in rat exclusions
URL: https://github.com/apache/beam/pull/5002
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/.gitignore b/.gitignore
index e81a4e379c8..69373cba747 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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/
diff --git a/build.gradle b/build.gradle
index ad58db61eeb..e924202df6d 100644
--- a/build.gradle
+++ b/build.gradle
@@ -67,76 +67,9 @@ apply plugin: "base"
 
 // Apply one top level rat plugin to perform any required license enforcement 
analysis
 apply plugin: "org.nosphere.apache.rat"
-rat {
-  plainOutput = true
-  xmlOutput = false
-  htmlOutput = false
-  failOnError = true
-  excludes = [
-    // 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/**/*",
 
+rat {
+  def exclusions = [
     // Ignore files we track but do not distribute
     ".github/**/*",
 
@@ -157,6 +90,22 @@ rat {
     // VCF test files
     "**/apache_beam/testing/data/vcf/*",
   ]
+
+  // 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('#') }
+    println "Adding ${gitIgnoreExcludes.size()} .gitignore exclusions to 
Apache Rat"
+    exclusions.addAll(gitIgnoreExcludes)
+  }
+
+  plainOutput = true
+  xmlOutput = false
+  htmlOutput = false
+  failOnError = true
+  excludes = exclusions
 }
 check.dependsOn rat
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 87585)
    Time Spent: 1h  (was: 50m)

> rat doesn't pass with gradle
> ----------------------------
>
>                 Key: BEAM-3993
>                 URL: https://issues.apache.org/jira/browse/BEAM-3993
>             Project: Beam
>          Issue Type: Sub-task
>          Components: build-system
>            Reporter: Romain Manni-Bucau
>            Assignee: Romain Manni-Bucau
>            Priority: Major
>             Fix For: 2.5.0
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to