uschindler commented on a change in pull request #1830:
URL: https://github.com/apache/lucene-solr/pull/1830#discussion_r483944258



##########
File path: gradle/validation/validate-source-patterns.gradle
##########
@@ -29,50 +33,117 @@ buildscript {
   }
 }
 
-configure(rootProject) {
-  task("validateSourcePatterns", type: ValidateSourcePatternsTask) { task ->
+def extensions = [
+    'adoc',
+    'bat',
+    'cmd',
+    'css',
+    'g4',
+    'gradle',
+    'groovy',
+    'html',
+    'java',
+    'jflex',
+    'jj',
+    'js',
+    'json',
+    'mdtext',
+    'pl',
+    'policy',
+    'properties',
+    'py',
+    'sh',
+    'template',
+    'vm',
+    'xml',
+    'xsl',
+]
+
+// Create source validation task local for each project's files.
+subprojects {
+  task validateSourcePatterns(type: ValidateSourcePatternsTask) { task ->
     group = 'Verification'
     description = 'Validate Source Patterns'
 
     // This task has no proper outputs.
     setupDummyOutputs(task)
 
-    sourceFiles = project.fileTree(project.rootDir) {
-      [
-        'java', 'jflex', 'py', 'pl', 'g4', 'jj', 'html', 'js',
-        'css', 'xml', 'xsl', 'vm', 'sh', 'cmd', 'bat', 'policy',
-        'properties', 'mdtext', 'groovy', 'gradle',
-        'template', 'adoc', 'json',
-      ].each{
-        include "lucene/**/*.${it}"
-        include "solr/**/*.${it}"
-        include "dev-tools/**/*.${it}"
-        include "gradle/**/*.${it}"
+    sourceFiles = fileTree(projectDir) {
+      extensions.each{
+        include "*.${it}"
+      }
+
+      // default excludes.
+      exclude "$buildDir/**"
+      exclude '**/dist/**'
+      exclude 'dev-tools/missing-doclet/src/**/*.java' // <-- TODO: remove 
once we allow "var" on master
+      exclude 'lucene/benchmark/work/**'

Review comment:
       this wont work in per directory setting -> remove 
   same for solr a bit down.

##########
File path: gradle/validation/validate-source-patterns.gradle
##########
@@ -181,8 +252,13 @@ class ValidateSourcePatternsTask extends DefaultTask {
       }
     }
 
+    ProgressLogger progress = progressLoggerFactory.newOperation(this.class)
+    progress.start(this.name, this.name)
+
     sourceFiles.each{ f ->
-      logger.debug('Scanning source file: {}', f);
+      progress.progress("Scanning ${f.name}")
+      logger.info('Scanning source file: {}', f);

Review comment:
       I would keep this as debug or remove after adding the progress meter.
   I often try to run gradlew with `--info`, but theis is way too much 
information.
   
   Do you know how to silence the palantir version-lock checker? I hate that it 
prints so much information during configuration phase to info.
   
   I'd like to enable `--info` on jenkins, but that's way to much.

##########
File path: gradle/validation/validate-source-patterns.gradle
##########
@@ -29,50 +33,117 @@ buildscript {
   }
 }
 
-configure(rootProject) {
-  task("validateSourcePatterns", type: ValidateSourcePatternsTask) { task ->
+def extensions = [
+    'adoc',
+    'bat',
+    'cmd',
+    'css',
+    'g4',
+    'gradle',
+    'groovy',
+    'html',
+    'java',
+    'jflex',
+    'jj',
+    'js',
+    'json',
+    'mdtext',
+    'pl',
+    'policy',
+    'properties',
+    'py',
+    'sh',
+    'template',
+    'vm',
+    'xml',
+    'xsl',
+]
+
+// Create source validation task local for each project's files.
+subprojects {
+  task validateSourcePatterns(type: ValidateSourcePatternsTask) { task ->
     group = 'Verification'
     description = 'Validate Source Patterns'
 
     // This task has no proper outputs.
     setupDummyOutputs(task)
 
-    sourceFiles = project.fileTree(project.rootDir) {
-      [
-        'java', 'jflex', 'py', 'pl', 'g4', 'jj', 'html', 'js',
-        'css', 'xml', 'xsl', 'vm', 'sh', 'cmd', 'bat', 'policy',
-        'properties', 'mdtext', 'groovy', 'gradle',
-        'template', 'adoc', 'json',
-      ].each{
-        include "lucene/**/*.${it}"
-        include "solr/**/*.${it}"
-        include "dev-tools/**/*.${it}"
-        include "gradle/**/*.${it}"
+    sourceFiles = fileTree(projectDir) {
+      extensions.each{
+        include "*.${it}"
+      }
+
+      // default excludes.
+      exclude "$buildDir/**"
+      exclude '**/dist/**'
+      exclude 'dev-tools/missing-doclet/src/**/*.java' // <-- TODO: remove 
once we allow "var" on master
+      exclude 'lucene/benchmark/work/**'

Review comment:
       But if the code does not fail, mabe remove the exclude (outdated?).

##########
File path: gradle/validation/validate-source-patterns.gradle
##########
@@ -181,8 +252,13 @@ class ValidateSourcePatternsTask extends DefaultTask {
       }
     }
 
+    ProgressLogger progress = progressLoggerFactory.newOperation(this.class)
+    progress.start(this.name, this.name)
+
     sourceFiles.each{ f ->
-      logger.debug('Scanning source file: {}', f);
+      progress.progress("Scanning ${f.name}")

Review comment:
       Cool!




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to