dweiss commented on a change in pull request #1267: LUCENE-9201: Add missing 
javadocs check task
URL: https://github.com/apache/lucene-solr/pull/1267#discussion_r382988556
 
 

 ##########
 File path: gradle/validation/missing-docs-check.gradle
 ##########
 @@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+configure(rootProject) {
+  ext {
+    // too many classes to fix overall to just enable the above to be 
level="method" right now,
+    // but we can prevent the modules that don't have problems from getting 
any worse
+    methodLevels = [
+      ':lucene:analysis:icu',
+      ':lucene:analysis:morfologik',
+      ':lucene:analysis:phonetic',
+      ':lucene:analysis:stempel',
+      ':lucene:classification',
+      ':lucene:demo',
+      ':lucene:expressions',
+      ':lucene:facet',
+      ':lucene:join',
+      ':lucene:memory',
+      ':lucene:suggest',
+      ':lucene:spatial3d',
+    ]
+  }
+}
+
+allprojects {
+  plugins.withType(JavaPlugin) {
+
+    // set the default check level for each project
+    def lv = {
+      if (project.path.startsWith(':solr')) 'package'  // todo: add missing 
docs for all classes and bump this to level=class
+      else if (project.path in rootProject.methodLevels ) 'method'
+      else 'class'
+    }
+
+    task checkMissingDocsDefault(type: CheckMissingDocsTask, dependsOn: 
'javadoc') {
+      enabled = project.javadoc.destinationDir.exists()
 
 Review comment:
   this is incorrect -- when you run the task on a clean checkout it'd skip the 
task (because javadoc folder doesn't exist). The empty-folder check should be 
moved inside the task (if it's at all needed since I assume javadoc should 
always be present if this task depends on javadoc).

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to