You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/09/05 11:58:36 UTC

[GitHub] [lucene-solr] uschindler commented on a change in pull request #1830: LUCENE-9506: Gradle: split validateSourcePatterns into per-project an…

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



##########
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.

Review comment:
       I agree with this. Maybe make a closure out of it, so it can be applied everywhere. I can do this, if you like.




----------------------------------------------------------------
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:
users@infra.apache.org



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