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/05/16 09:24:49 UTC

[GitHub] [lucene-solr] mocobeta opened a new pull request #1522: LUCENE-9374: Add doclumentationLint gradle task

mocobeta opened a new pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522


   ## Description
   
   This adds `documentationLint` task to gradle build. The task is a placeholder for `:lucene:checkBrokenLinks` and `:solr:checkBrokenLinks` that detect broken or invalid links in docs under `_project_/build/documentation`. 
   For now, both check tasks fail as there are broken links in the javadocs.
   
   See also https://issues.apache.org/jira/browse/LUCENE-9374
   
   ## Gradle command
   
   ```
   ./gradlew documentationLint
   ```
   
   or 
   
   ```
   ./gradlew :lucene:checkBrokenLinks
   ./gradlew :solr:checkBrokenLinks
   ```
   
   ## Note
   
   - I added `documentationLint` task that wraps `checkBrokenLinks` to align semantics with `documentation` task, but it can be removed if not needed.
   - `documentation-lint.gradle` could be placed under `gradle/documentation` ?


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


[GitHub] [lucene-solr] uschindler commented on a change in pull request #1522: LUCENE-9374: Add doclumentationLint gradle task

Posted by GitBox <gi...@apache.org>.
uschindler commented on a change in pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#discussion_r426256285



##########
File path: gradle/validation/documentation-lint.gradle
##########
@@ -0,0 +1,72 @@
+/*
+ * 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) {
+
+  task documentationLint {
+    group 'Verification'
+    description 'Verify all documentation'
+
+    dependsOn ':lucene:checkBrokenLinks'
+    dependsOn ':solr:checkBrokenLinks'
+  }
+}
+
+configure(subprojects.findAll { it.path in [':lucene', ':solr'] }) {
+
+  project.afterEvaluate {
+    task checkBrokenLinks(type: CheckBrokenLinksTask) {
+      docsDir = project.docroot
+      dependsOn subprojects.collect { prj ->

Review comment:
       Just depend on `:lucene:documentation`and `:solr:documentation`. Will merge #1477 soon.




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


[GitHub] [lucene-solr] mocobeta commented on a change in pull request #1522: LUCENE-9374: Add doclumentationLint gradle task

Posted by GitBox <gi...@apache.org>.
mocobeta commented on a change in pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#discussion_r426146216



##########
File path: gradle/validation/documentation-lint.gradle
##########
@@ -0,0 +1,65 @@
+/*
+ * 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) {
+
+  task documentationLint {
+    group 'Verification'
+    description 'Verify all documentation'
+
+    dependsOn 'documentation'
+    dependsOn subprojects.collect { prj ->
+      prj.tasks.matching { task -> task.name == 'checkBrokenLinks'}
+    }
+  }
+
+  // TODO: uncomment this line after fixing all broken links.
+  // (we can't fix the cross-project links until ant build is disabled.)
+  // check.dependsOn documentationLint
+}
+
+configure(subprojects.findAll { it.path in [':lucene', ':solr'] }) {
+  task checkBrokenLinks(type: CheckBrokenLinksTask)
+}
+
+class CheckBrokenLinksTask extends DefaultTask {
+  @Input
+  File docsDir = project.docroot

Review comment:
       Btw, render-javadoc.gradle (renderSiteJavadoc) also eagarly evaluate the property (I first referred the task and did the same), so it fails if the order is changed in root `build.gradle`. 
   https://github.com/apache/lucene-solr/blob/master/gradle/render-javadoc.gradle#L59




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


[GitHub] [lucene-solr] mocobeta commented on a change in pull request #1522: LUCENE-9374: Add doclumentationLint gradle task

Posted by GitBox <gi...@apache.org>.
mocobeta commented on a change in pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#discussion_r426144248



##########
File path: gradle/validation/documentation-lint.gradle
##########
@@ -0,0 +1,65 @@
+/*
+ * 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) {
+
+  task documentationLint {
+    group 'Verification'
+    description 'Verify all documentation'
+
+    dependsOn 'documentation'
+    dependsOn subprojects.collect { prj ->

Review comment:
       I updated the task dependencies. 
   
   Should we remove entire `documentationLink` task, or is it useful to have?




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


[GitHub] [lucene-solr] mocobeta commented on a change in pull request #1522: LUCENE-9374: Add checkBrokenLinks gradle task

Posted by GitBox <gi...@apache.org>.
mocobeta commented on a change in pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#discussion_r426971028



##########
File path: gradle/validation/check-broken-links.gradle
##########
@@ -0,0 +1,68 @@
+/*
+ * 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) {
+
+  task checkBrokenLinks {
+    group 'Verification'
+    description 'Check broken links in the entire documentation'
+
+    dependsOn ':lucene:checkBrokenLinks'
+    dependsOn ':solr:checkBrokenLinks'
+  }
+
+}
+configure(subprojects.findAll { it.path in [':lucene', ':solr'] }) {
+
+  task checkBrokenLinks(type: CheckBrokenLinksTask, 'dependsOn': 'documentation')
+
+  // TODO: uncomment this line after fixing all broken links.
+  // (we can't fix the cross-project links until ant build is disabled.)
+  // check.dependsOn checkBrokenLinks
+}
+
+class CheckBrokenLinksTask extends DefaultTask {
+
+  @Input
+  Provider<File> docsDir = project.providers.provider { project.docroot }
+
+  @Input

Review comment:
       Fixed.




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


[GitHub] [lucene-solr] uschindler commented on a change in pull request #1522: LUCENE-9374: Add doclumentationLint gradle task

Posted by GitBox <gi...@apache.org>.
uschindler commented on a change in pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#discussion_r426257605



##########
File path: gradle/validation/documentation-lint.gradle
##########
@@ -0,0 +1,72 @@
+/*
+ * 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) {
+
+  task documentationLint {
+    group 'Verification'
+    description 'Verify all documentation'
+
+    dependsOn ':lucene:checkBrokenLinks'
+    dependsOn ':solr:checkBrokenLinks'
+  }
+}
+
+configure(subprojects.findAll { it.path in [':lucene', ':solr'] }) {
+
+  project.afterEvaluate {
+    task checkBrokenLinks(type: CheckBrokenLinksTask) {
+      docsDir = project.docroot
+      dependsOn subprojects.collect { prj ->

Review comment:
       OK #1477 is merged to master, just update your PR and change dependency. Thanks, Uwe




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


[GitHub] [lucene-solr] dweiss commented on pull request #1522: LUCENE-9374: Add checkBrokenLinks gradle task

Posted by GitBox <gi...@apache.org>.
dweiss commented on pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#issuecomment-630892331


   It's fine, although the snippet I copy-pasted showed a way which I think is more elegant in the long term: separates the actual property configuration bit from its declaration in the task. The difference is subtle - if we move the task to buildSrc, for example, the configuration can still happen in the relevant part of the script  but the task stays precompiled and ready. These are tiny things that definitely can be polished later on.


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


[GitHub] [lucene-solr] uschindler commented on a change in pull request #1522: LUCENE-9374: Add doclumentationLint gradle task

Posted by GitBox <gi...@apache.org>.
uschindler commented on a change in pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#discussion_r426258537



##########
File path: gradle/validation/documentation-lint.gradle
##########
@@ -0,0 +1,65 @@
+/*
+ * 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) {
+
+  task documentationLint {
+    group 'Verification'
+    description 'Verify all documentation'
+
+    dependsOn 'documentation'
+    dependsOn subprojects.collect { prj ->
+      prj.tasks.matching { task -> task.name == 'checkBrokenLinks'}
+    }
+  }
+
+  // TODO: uncomment this line after fixing all broken links.
+  // (we can't fix the cross-project links until ant build is disabled.)
+  // check.dependsOn documentationLint
+}
+
+configure(subprojects.findAll { it.path in [':lucene', ':solr'] }) {
+  task checkBrokenLinks(type: CheckBrokenLinksTask)
+}
+
+class CheckBrokenLinksTask extends DefaultTask {
+  @Input
+  File docsDir = project.docroot

Review comment:
       You can have a look at #1477, there I am also using lazy evaluation (see `bindings`) property. It's a MapProvider and the values are lazily evaluated using `project.providers.property{ ... lazy code ... }`




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


[GitHub] [lucene-solr] dweiss commented on a change in pull request #1522: LUCENE-9374: Add doclumentationLint gradle task

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#discussion_r426183659



##########
File path: gradle/validation/documentation-lint.gradle
##########
@@ -0,0 +1,65 @@
+/*
+ * 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) {
+
+  task documentationLint {
+    group 'Verification'
+    description 'Verify all documentation'
+
+    dependsOn 'documentation'
+    dependsOn subprojects.collect { prj ->
+      prj.tasks.matching { task -> task.name == 'checkBrokenLinks'}
+    }
+  }
+
+  // TODO: uncomment this line after fixing all broken links.
+  // (we can't fix the cross-project links until ant build is disabled.)
+  // check.dependsOn documentationLint
+}
+
+configure(subprojects.findAll { it.path in [':lucene', ':solr'] }) {
+  task checkBrokenLinks(type: CheckBrokenLinksTask)
+}
+
+class CheckBrokenLinksTask extends DefaultTask {
+  @Input
+  File docsDir = project.docroot

Review comment:
       I wasn't talking about afterEvaluate, actually. I think some properties can be declared as lazy and then assigned a provider - this is different than afterEvaluate. Look here: 
   https://docs.gradle.org/current/userguide/lazy_configuration.html
   
   As for order dependencies: afterEvaluate only shifts the problem until later because you still can have dependency ordering problems between afterEvaluate closures... ;) It's not the perfect solution (but of course works reasonably well most of the time).




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


[GitHub] [lucene-solr] dweiss commented on a change in pull request #1522: LUCENE-9374: Add doclumentationLint gradle task

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#discussion_r426136886



##########
File path: build.gradle
##########
@@ -134,3 +134,4 @@ apply from: file('gradle/ant-compat/forbidden-api-rules-in-sync.gradle')
 apply from: file('gradle/documentation/documentation.gradle')
 apply from: file('gradle/documentation/changes-to-html.gradle')
 apply from: file('gradle/render-javadoc.gradle')
+apply from: file('gradle/validation/documentation-lint.gradle')  // should be placed here; needs to be evaluated after documentation.gradle

Review comment:
       There is already a comment about include ordering above I believe, but fine.

##########
File path: gradle/validation/documentation-lint.gradle
##########
@@ -0,0 +1,65 @@
+/*
+ * 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) {
+
+  task documentationLint {
+    group 'Verification'
+    description 'Verify all documentation'
+
+    dependsOn 'documentation'
+    dependsOn subprojects.collect { prj ->
+      prj.tasks.matching { task -> task.name == 'checkBrokenLinks'}
+    }
+  }
+
+  // TODO: uncomment this line after fixing all broken links.

Review comment:
       I would add (commented out) check.dependsOn checkBrokenLinks to task declaration per-project as well so that when you run gradlew -p lucene check the validation runs on a per-project basis too.

##########
File path: gradle/validation/documentation-lint.gradle
##########
@@ -0,0 +1,65 @@
+/*
+ * 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) {
+
+  task documentationLint {
+    group 'Verification'
+    description 'Verify all documentation'
+
+    dependsOn 'documentation'
+    dependsOn subprojects.collect { prj ->
+      prj.tasks.matching { task -> task.name == 'checkBrokenLinks'}
+    }
+  }
+
+  // TODO: uncomment this line after fixing all broken links.
+  // (we can't fix the cross-project links until ant build is disabled.)
+  // check.dependsOn documentationLint
+}
+
+configure(subprojects.findAll { it.path in [':lucene', ':solr'] }) {
+  task checkBrokenLinks(type: CheckBrokenLinksTask)
+}
+
+class CheckBrokenLinksTask extends DefaultTask {
+  @Input
+  File docsDir = project.docroot

Review comment:
       (I don't know how to do this without changing field signature) but ideally this should be a lazy provider returning project.docroot. This would make it evaluation-order independent and would trigger input evaluation only if the task actually runs.
   
   Just a thought if you want to get deeper into gradle. ;)

##########
File path: gradle/validation/documentation-lint.gradle
##########
@@ -0,0 +1,65 @@
+/*
+ * 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) {
+
+  task documentationLint {
+    group 'Verification'
+    description 'Verify all documentation'
+
+    dependsOn 'documentation'
+    dependsOn subprojects.collect { prj ->

Review comment:
       This can be explicit since there are only two? (":lucene:checkBrokenLinks", ":solr:checkBrokenLinks")?




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


[GitHub] [lucene-solr] uschindler commented on a change in pull request #1522: LUCENE-9374: Add checkBrokenLinks gradle task

Posted by GitBox <gi...@apache.org>.
uschindler commented on a change in pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#discussion_r426401368



##########
File path: gradle/validation/documentation-lint.gradle
##########
@@ -0,0 +1,65 @@
+/*
+ * 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) {
+
+  task documentationLint {
+    group 'Verification'
+    description 'Verify all documentation'
+
+    dependsOn 'documentation'
+    dependsOn subprojects.collect { prj ->
+      prj.tasks.matching { task -> task.name == 'checkBrokenLinks'}
+    }
+  }
+
+  // TODO: uncomment this line after fixing all broken links.
+  // (we can't fix the cross-project links until ant build is disabled.)
+  // check.dependsOn documentationLint
+}
+
+configure(subprojects.findAll { it.path in [':lucene', ':solr'] }) {
+  task checkBrokenLinks(type: CheckBrokenLinksTask)
+}
+
+class CheckBrokenLinksTask extends DefaultTask {
+  @Input
+  File docsDir = project.docroot

Review comment:
       You can use a `RegularFileProperty` instead of a File and then use `providers.property{...}` to assign value. Gradle DSL does not change, just when using it from Groovy code or Java code, you have to call `get().getAsFile()` (which does lazy evaluation).
   I did not use that for render-javadocs, becuase it was not needed.
   
   Another "simple" way for lazy evaluation (works only with Strings, but its often helpful) is to use GString (double quoted Strings): `GString someProperty = "${->project.docroot}"` (please note the `->`). Whenever `toString()` or `as String` is called, its lazinly evaluated. Without the `->` the value is inserted into the string at parsing time.
   
   I had the same problem with #1477, but I will plan to do this for the URL coming from an extension:
   
   ```groovy
     @Input
     def luceneDocUrl = "${->project.luceneDocUrl}"
   
     @Input
     def solrDocUrl = "${->project.solrDocUrl}"  
   ```




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


[GitHub] [lucene-solr] uschindler commented on a change in pull request #1522: LUCENE-9374: Add checkBrokenLinks gradle task

Posted by GitBox <gi...@apache.org>.
uschindler commented on a change in pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#discussion_r426401368



##########
File path: gradle/validation/documentation-lint.gradle
##########
@@ -0,0 +1,65 @@
+/*
+ * 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) {
+
+  task documentationLint {
+    group 'Verification'
+    description 'Verify all documentation'
+
+    dependsOn 'documentation'
+    dependsOn subprojects.collect { prj ->
+      prj.tasks.matching { task -> task.name == 'checkBrokenLinks'}
+    }
+  }
+
+  // TODO: uncomment this line after fixing all broken links.
+  // (we can't fix the cross-project links until ant build is disabled.)
+  // check.dependsOn documentationLint
+}
+
+configure(subprojects.findAll { it.path in [':lucene', ':solr'] }) {
+  task checkBrokenLinks(type: CheckBrokenLinksTask)
+}
+
+class CheckBrokenLinksTask extends DefaultTask {
+  @Input
+  File docsDir = project.docroot

Review comment:
       You can use a `DirectoryProperty` instead of a File and then use `providers.property{...}` to assign value. Gradle DSL does not change, just when using it from Groovy code or Java code, you have to call `.getAsFile().get()` (which does lazy evaluation).
   I did not use that for render-javadocs, becuase it was not needed.
   
   Another "simple" way for lazy evaluation (works only with Strings, but its often helpful) is to use GString (double quoted Strings): `GString someProperty = "${->project.docroot}"` (please note the `->`). Whenever `toString()` or `as String` is called, its lazinly evaluated. Without the `->` the value is inserted into the string at parsing time.
   
   I had the same problem with #1477, but I will plan to do this for the URL coming from an extension:
   
   ```groovy
     @Input
     def luceneDocUrl = "${->project.luceneDocUrl}"
   
     @Input
     def solrDocUrl = "${->project.solrDocUrl}"  
   ```




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


[GitHub] [lucene-solr] mocobeta commented on a change in pull request #1522: LUCENE-9374: Add checkBrokenLinks gradle task

Posted by GitBox <gi...@apache.org>.
mocobeta commented on a change in pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#discussion_r426656931



##########
File path: gradle/validation/documentation-lint.gradle
##########
@@ -0,0 +1,65 @@
+/*
+ * 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) {
+
+  task documentationLint {
+    group 'Verification'
+    description 'Verify all documentation'
+
+    dependsOn 'documentation'
+    dependsOn subprojects.collect { prj ->
+      prj.tasks.matching { task -> task.name == 'checkBrokenLinks'}
+    }
+  }
+
+  // TODO: uncomment this line after fixing all broken links.
+  // (we can't fix the cross-project links until ant build is disabled.)
+  // check.dependsOn documentationLint
+}
+
+configure(subprojects.findAll { it.path in [':lucene', ':solr'] }) {
+  task checkBrokenLinks(type: CheckBrokenLinksTask)
+}
+
+class CheckBrokenLinksTask extends DefaultTask {
+  @Input
+  File docsDir = project.docroot

Review comment:
       Thanks for the pointers. `project.providers.provider { project.docroot }` perfectly works for me. https://github.com/apache/lucene-solr/pull/1522/commits/ac195d147a3b7d25605ca98034028f9719913782 
   (`${->project.docroot}` also works fine; I like using `Provider<File>` signature here.)
   
   On the master branch, `gradlew renderSiteJavadoc` fails with this error when I reverse evaluation order of `gradle/render-javadoc.gradle` and `gradle/documentation/documentation.gradle`.
   ```
   > Could not get unknown property 'docroot' for project ':solr:core' of type org.gradle.api.Project.
   ```
   I think it'd be better doing the same for render-javadoc.gradle just for safety, or add some comments about the ordering on `build.gradle` to prevent someone accidentally changes the file?




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


[GitHub] [lucene-solr] mocobeta commented on pull request #1522: LUCENE-9374: Add checkBrokenLinks gradle task

Posted by GitBox <gi...@apache.org>.
mocobeta commented on pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#issuecomment-631169757


   Thanks for reviewing. I plan to merge the branch to the master in shortly (if there's no other feedback).


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


[GitHub] [lucene-solr] uschindler commented on a change in pull request #1522: LUCENE-9374: Add checkBrokenLinks gradle task

Posted by GitBox <gi...@apache.org>.
uschindler commented on a change in pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#discussion_r427252786



##########
File path: gradle/validation/check-broken-links.gradle
##########
@@ -0,0 +1,68 @@
+/*
+ * 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) {
+
+  task checkBrokenLinks {
+    group 'Verification'
+    description 'Check broken links in the entire documentation'
+
+    dependsOn ':lucene:checkBrokenLinks'
+    dependsOn ':solr:checkBrokenLinks'
+  }
+
+}
+configure(subprojects.findAll { it.path in [':lucene', ':solr'] }) {
+
+  task checkBrokenLinks(type: CheckBrokenLinksTask, 'dependsOn': 'documentation')
+
+  // TODO: uncomment this line after fixing all broken links.
+  // (we can't fix the cross-project links until ant build is disabled.)
+  // check.dependsOn checkBrokenLinks
+}
+
+class CheckBrokenLinksTask extends DefaultTask {
+
+  @Input

Review comment:
       Thanks!




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


[GitHub] [lucene-solr] mocobeta commented on a change in pull request #1522: LUCENE-9374: Add doclumentationLint gradle task

Posted by GitBox <gi...@apache.org>.
mocobeta commented on a change in pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#discussion_r426198869



##########
File path: gradle/validation/documentation-lint.gradle
##########
@@ -0,0 +1,65 @@
+/*
+ * 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) {
+
+  task documentationLint {
+    group 'Verification'
+    description 'Verify all documentation'
+
+    dependsOn 'documentation'
+    dependsOn subprojects.collect { prj ->
+      prj.tasks.matching { task -> task.name == 'checkBrokenLinks'}
+    }
+  }
+
+  // TODO: uncomment this line after fixing all broken links.
+  // (we can't fix the cross-project links until ant build is disabled.)
+  // check.dependsOn documentationLint
+}
+
+configure(subprojects.findAll { it.path in [':lucene', ':solr'] }) {
+  task checkBrokenLinks(type: CheckBrokenLinksTask)
+}
+
+class CheckBrokenLinksTask extends DefaultTask {
+  @Input
+  File docsDir = project.docroot

Review comment:
       ah... thanks for correction. I misunderstood the meaning of afterEvaluation. I will come back next week.




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


[GitHub] [lucene-solr] dweiss commented on a change in pull request #1522: LUCENE-9374: Add checkBrokenLinks gradle task

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#discussion_r427124063



##########
File path: gradle/validation/check-broken-links.gradle
##########
@@ -0,0 +1,68 @@
+/*
+ * 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) {
+
+  task checkBrokenLinks {
+    group 'Verification'
+    description 'Check broken links in the entire documentation'
+
+    dependsOn ':lucene:checkBrokenLinks'
+    dependsOn ':solr:checkBrokenLinks'
+  }
+
+}
+configure(subprojects.findAll { it.path in [':lucene', ':solr'] }) {
+
+  task checkBrokenLinks(type: CheckBrokenLinksTask, 'dependsOn': 'documentation')
+
+  // TODO: uncomment this line after fixing all broken links.
+  // (we can't fix the cross-project links until ant build is disabled.)
+  // check.dependsOn checkBrokenLinks
+}
+
+class CheckBrokenLinksTask extends DefaultTask {
+
+  @Input

Review comment:
       This works for me and is what I had in mind:
   ```
    configure(subprojects.findAll { it.path in [':lucene', ':solr'] }) {
    
   -  task checkBrokenLinks(type: CheckBrokenLinksTask, 'dependsOn': 'documentation')
   +  task checkBrokenLinks(type: CheckBrokenLinksTask, 'dependsOn': 'documentation') {
   +    docsDir = project.layout.dir provider { project.docroot }
   +  }
    
      // TODO: uncomment this line after fixing all broken links.
      // (we can't fix the cross-project links until ant build is disabled.)
   @@ -38,7 +39,7 @@ configure(subprojects.findAll { it.path in [':lucene', ':solr'] }) {
    class CheckBrokenLinksTask extends DefaultTask {
    
      @InputDirectory
   -  final Provider<File> docsDir = project.providers.provider { project.docroot }
   +  final DirectoryProperty docsDir = project.objects.directoryProperty()
    
      @InputFile
      File script = project.rootProject.file("dev-tools/scripts/checkJavadocLinks.py")
   @@ -56,7 +57,7 @@ class CheckBrokenLinksTask extends DefaultTask {
            args = [
              "-B",
              script.absolutePath,
   -          docsDir.get().absolutePath
   +          docsDir.get().asFile
            ]
          }
        } 
   ```
   
   Any version is fine though, I don't mind.




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


[GitHub] [lucene-solr] uschindler commented on a change in pull request #1522: LUCENE-9374: Add doclumentationLint gradle task

Posted by GitBox <gi...@apache.org>.
uschindler commented on a change in pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#discussion_r426146539



##########
File path: gradle/validation/documentation-lint.gradle
##########
@@ -0,0 +1,72 @@
+/*
+ * 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) {
+
+  task documentationLint {
+    group 'Verification'
+    description 'Verify all documentation'
+
+    dependsOn ':lucene:checkBrokenLinks'
+    dependsOn ':solr:checkBrokenLinks'
+  }
+}
+
+configure(subprojects.findAll { it.path in [':lucene', ':solr'] }) {
+
+  project.afterEvaluate {
+    task checkBrokenLinks(type: CheckBrokenLinksTask) {
+      docsDir = project.docroot
+      dependsOn subprojects.collect { prj ->

Review comment:
       I think that should just depend on the documentation task, so it can also check the index.html files and all other stuff.
   I think the python script will also find errors introduced by the markdown stuff. At least it did when I broke the ant task in #1477. 
   
   #1477 is ready for review, once it is erged you can test more.




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


[GitHub] [lucene-solr] mocobeta commented on a change in pull request #1522: LUCENE-9374: Add doclumentationLint gradle task

Posted by GitBox <gi...@apache.org>.
mocobeta commented on a change in pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#discussion_r426143823



##########
File path: build.gradle
##########
@@ -134,3 +134,4 @@ apply from: file('gradle/ant-compat/forbidden-api-rules-in-sync.gradle')
 apply from: file('gradle/documentation/documentation.gradle')
 apply from: file('gradle/documentation/changes-to-html.gradle')
 apply from: file('gradle/render-javadoc.gradle')
+apply from: file('gradle/validation/documentation-lint.gradle')  // should be placed here; needs to be evaluated after documentation.gradle

Review comment:
       With lazy evaluation for 'docroot', the evaluation order does not matter so I moved this line to proper location. (I clearly missed the comment "The order of inclusion of these files shouldn't matter".)




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


[GitHub] [lucene-solr] uschindler commented on a change in pull request #1522: LUCENE-9374: Add doclumentationLint gradle task

Posted by GitBox <gi...@apache.org>.
uschindler commented on a change in pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#discussion_r426256449



##########
File path: gradle/validation/documentation-lint.gradle
##########
@@ -0,0 +1,72 @@
+/*
+ * 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) {
+
+  task documentationLint {
+    group 'Verification'
+    description 'Verify all documentation'
+
+    dependsOn ':lucene:checkBrokenLinks'
+    dependsOn ':solr:checkBrokenLinks'
+  }
+}
+
+configure(subprojects.findAll { it.path in [':lucene', ':solr'] }) {
+
+  project.afterEvaluate {
+    task checkBrokenLinks(type: CheckBrokenLinksTask) {
+      docsDir = project.docroot
+      dependsOn subprojects.collect { prj ->

Review comment:
       Thats the IMHO "better" code after #1477 is merged:
   
   `dependsOn "documentation"` 




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


[GitHub] [lucene-solr] mocobeta merged pull request #1522: LUCENE-9374: Add checkBrokenLinks gradle task

Posted by GitBox <gi...@apache.org>.
mocobeta merged pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522


   


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


[GitHub] [lucene-solr] uschindler commented on a change in pull request #1522: LUCENE-9374: Add checkBrokenLinks gradle task

Posted by GitBox <gi...@apache.org>.
uschindler commented on a change in pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#discussion_r427087643



##########
File path: gradle/validation/check-broken-links.gradle
##########
@@ -0,0 +1,68 @@
+/*
+ * 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) {
+
+  task checkBrokenLinks {
+    group 'Verification'
+    description 'Check broken links in the entire documentation'
+
+    dependsOn ':lucene:checkBrokenLinks'
+    dependsOn ':solr:checkBrokenLinks'
+  }
+
+}
+configure(subprojects.findAll { it.path in [':lucene', ':solr'] }) {
+
+  task checkBrokenLinks(type: CheckBrokenLinksTask, 'dependsOn': 'documentation')
+
+  // TODO: uncomment this line after fixing all broken links.
+  // (we can't fix the cross-project links until ant build is disabled.)
+  // check.dependsOn checkBrokenLinks
+}
+
+class CheckBrokenLinksTask extends DefaultTask {
+
+  @Input

Review comment:
       of course it's a directory, sorry!




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


[GitHub] [lucene-solr] dweiss commented on a change in pull request #1522: LUCENE-9374: Add checkBrokenLinks gradle task

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#discussion_r427089469



##########
File path: gradle/validation/check-broken-links.gradle
##########
@@ -0,0 +1,68 @@
+/*
+ * 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) {
+
+  task checkBrokenLinks {
+    group 'Verification'
+    description 'Check broken links in the entire documentation'
+
+    dependsOn ':lucene:checkBrokenLinks'
+    dependsOn ':solr:checkBrokenLinks'
+  }
+
+}
+configure(subprojects.findAll { it.path in [':lucene', ':solr'] }) {
+
+  task checkBrokenLinks(type: CheckBrokenLinksTask, 'dependsOn': 'documentation')
+
+  // TODO: uncomment this line after fixing all broken links.
+  // (we can't fix the cross-project links until ant build is disabled.)
+  // check.dependsOn checkBrokenLinks
+}
+
+class CheckBrokenLinksTask extends DefaultTask {
+
+  @Input

Review comment:
       For reference - the difference is that Input is  just the file, InputFIle is the file and its contents (!). 
   https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/InputFile.html




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


[GitHub] [lucene-solr] mocobeta commented on a change in pull request #1522: LUCENE-9374: Add checkBrokenLinks gradle task

Posted by GitBox <gi...@apache.org>.
mocobeta commented on a change in pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#discussion_r427249419



##########
File path: gradle/validation/check-broken-links.gradle
##########
@@ -0,0 +1,68 @@
+/*
+ * 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) {
+
+  task checkBrokenLinks {
+    group 'Verification'
+    description 'Check broken links in the entire documentation'
+
+    dependsOn ':lucene:checkBrokenLinks'
+    dependsOn ':solr:checkBrokenLinks'
+  }
+
+}
+configure(subprojects.findAll { it.path in [':lucene', ':solr'] }) {
+
+  task checkBrokenLinks(type: CheckBrokenLinksTask, 'dependsOn': 'documentation')
+
+  // TODO: uncomment this line after fixing all broken links.
+  // (we can't fix the cross-project links until ant build is disabled.)
+  // check.dependsOn checkBrokenLinks
+}
+
+class CheckBrokenLinksTask extends DefaultTask {
+
+  @Input

Review comment:
       Thank you, https://github.com/apache/lucene-solr/pull/1522/commits/778701c97120fbc2e6578a545d7719ac19d82d75 works for me.




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


[GitHub] [lucene-solr] mocobeta commented on pull request #1522: LUCENE-9374: Add checkBrokenLinks gradle task

Posted by GitBox <gi...@apache.org>.
mocobeta commented on pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#issuecomment-630789427


   I fixed it on https://github.com/apache/lucene-solr/commit/51c15b8660b9d6a3e5979bf1e53a98262db413e9 (and accidentally logged "merge" commit in the master https://github.com/apache/lucene-solr/commit/3b09d30e69795388e655275d23f1e83be0556da7; sorry.)


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


[GitHub] [lucene-solr] mocobeta commented on a change in pull request #1522: LUCENE-9374: Add doclumentationLint gradle task

Posted by GitBox <gi...@apache.org>.
mocobeta commented on a change in pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#discussion_r426144730



##########
File path: gradle/validation/documentation-lint.gradle
##########
@@ -0,0 +1,65 @@
+/*
+ * 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) {
+
+  task documentationLint {
+    group 'Verification'
+    description 'Verify all documentation'
+
+    dependsOn 'documentation'
+    dependsOn subprojects.collect { prj ->
+      prj.tasks.matching { task -> task.name == 'checkBrokenLinks'}
+    }
+  }
+
+  // TODO: uncomment this line after fixing all broken links.
+  // (we can't fix the cross-project links until ant build is disabled.)
+  // check.dependsOn documentationLint
+}
+
+configure(subprojects.findAll { it.path in [':lucene', ':solr'] }) {
+  task checkBrokenLinks(type: CheckBrokenLinksTask)
+}
+
+class CheckBrokenLinksTask extends DefaultTask {
+  @Input
+  File docsDir = project.docroot

Review comment:
       Thanks, `project.afterEvaluate()` works for me (though can't figure out the way to lazily evaluate ext properties for the task field).




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


[GitHub] [lucene-solr] uschindler commented on pull request #1522: LUCENE-9374: Add checkBrokenLinks gradle task

Posted by GitBox <gi...@apache.org>.
uschindler commented on pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#issuecomment-630779242


   I think you can do the same "Provider<File> -> DirectoryProperty" change in the changes-to-html task that you modified yesterday.


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


[GitHub] [lucene-solr] uschindler commented on a change in pull request #1522: LUCENE-9374: Add checkBrokenLinks gradle task

Posted by GitBox <gi...@apache.org>.
uschindler commented on a change in pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#discussion_r426715760



##########
File path: gradle/validation/check-broken-links.gradle
##########
@@ -0,0 +1,68 @@
+/*
+ * 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) {
+
+  task checkBrokenLinks {
+    group 'Verification'
+    description 'Check broken links in the entire documentation'
+
+    dependsOn ':lucene:checkBrokenLinks'
+    dependsOn ':solr:checkBrokenLinks'
+  }
+
+}
+configure(subprojects.findAll { it.path in [':lucene', ':solr'] }) {
+
+  task checkBrokenLinks(type: CheckBrokenLinksTask, 'dependsOn': 'documentation')
+
+  // TODO: uncomment this line after fixing all broken links.
+  // (we can't fix the cross-project links until ant build is disabled.)
+  // check.dependsOn checkBrokenLinks
+}
+
+class CheckBrokenLinksTask extends DefaultTask {
+
+  @Input

Review comment:
       Should be `@InputFile`




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


[GitHub] [lucene-solr] mocobeta commented on a change in pull request #1522: LUCENE-9374: Add checkBrokenLinks gradle task

Posted by GitBox <gi...@apache.org>.
mocobeta commented on a change in pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#discussion_r426972295



##########
File path: gradle/validation/check-broken-links.gradle
##########
@@ -0,0 +1,68 @@
+/*
+ * 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) {
+
+  task checkBrokenLinks {
+    group 'Verification'
+    description 'Check broken links in the entire documentation'
+
+    dependsOn ':lucene:checkBrokenLinks'
+    dependsOn ':solr:checkBrokenLinks'
+  }
+
+}
+configure(subprojects.findAll { it.path in [':lucene', ':solr'] }) {
+
+  task checkBrokenLinks(type: CheckBrokenLinksTask, 'dependsOn': 'documentation')
+
+  // TODO: uncomment this line after fixing all broken links.
+  // (we can't fix the cross-project links until ant build is disabled.)
+  // check.dependsOn checkBrokenLinks
+}
+
+class CheckBrokenLinksTask extends DefaultTask {
+
+  @Input

Review comment:
       I replaced it with `@InputDirectory` (since `@InputFile` does not work for me.)




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


[GitHub] [lucene-solr] uschindler commented on a change in pull request #1522: LUCENE-9374: Add doclumentationLint gradle task

Posted by GitBox <gi...@apache.org>.
uschindler commented on a change in pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#discussion_r426256097



##########
File path: gradle/validation/documentation-lint.gradle
##########
@@ -0,0 +1,72 @@
+/*
+ * 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) {
+
+  task documentationLint {
+    group 'Verification'
+    description 'Verify all documentation'
+
+    dependsOn ':lucene:checkBrokenLinks'
+    dependsOn ':solr:checkBrokenLinks'
+  }
+}
+
+configure(subprojects.findAll { it.path in [':lucene', ':solr'] }) {
+
+  project.afterEvaluate {
+    task checkBrokenLinks(type: CheckBrokenLinksTask) {
+      docsDir = project.docroot
+      dependsOn subprojects.collect { prj ->

Review comment:
       Sorry I forgot to submit the review. I hate that github page, especially on smartphone! 

##########
File path: gradle/validation/documentation-lint.gradle
##########
@@ -0,0 +1,72 @@
+/*
+ * 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) {
+
+  task documentationLint {
+    group 'Verification'
+    description 'Verify all documentation'
+
+    dependsOn ':lucene:checkBrokenLinks'
+    dependsOn ':solr:checkBrokenLinks'
+  }
+}
+
+configure(subprojects.findAll { it.path in [':lucene', ':solr'] }) {
+
+  project.afterEvaluate {
+    task checkBrokenLinks(type: CheckBrokenLinksTask) {
+      docsDir = project.docroot
+      dependsOn subprojects.collect { prj ->

Review comment:
       I think that should just depend on the documentation task, so it can also check the index.html files and all other stuff.
   I think the python script will also find errors introduced by the markdown stuff. At least it did when I broke the ant task in #1477. 
   
   #1477 is ready for review, once it is merged you can test more.




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


[GitHub] [lucene-solr] mocobeta commented on a change in pull request #1522: LUCENE-9374: Add checkBrokenLinks gradle task

Posted by GitBox <gi...@apache.org>.
mocobeta commented on a change in pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#discussion_r426263459



##########
File path: gradle/validation/documentation-lint.gradle
##########
@@ -0,0 +1,72 @@
+/*
+ * 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) {
+
+  task documentationLint {
+    group 'Verification'
+    description 'Verify all documentation'
+
+    dependsOn ':lucene:checkBrokenLinks'
+    dependsOn ':solr:checkBrokenLinks'
+  }
+}
+
+configure(subprojects.findAll { it.path in [':lucene', ':solr'] }) {
+
+  project.afterEvaluate {
+    task checkBrokenLinks(type: CheckBrokenLinksTask) {
+      docsDir = project.docroot
+      dependsOn subprojects.collect { prj ->

Review comment:
       Thanks for the change. I merged the latest master and made "checkBrokenLinks" depend on "documentation".




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


[GitHub] [lucene-solr] uschindler commented on a change in pull request #1522: LUCENE-9374: Add checkBrokenLinks gradle task

Posted by GitBox <gi...@apache.org>.
uschindler commented on a change in pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#discussion_r426408284



##########
File path: gradle/validation/documentation-lint.gradle
##########
@@ -0,0 +1,65 @@
+/*
+ * 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) {
+
+  task documentationLint {
+    group 'Verification'
+    description 'Verify all documentation'
+
+    dependsOn 'documentation'
+    dependsOn subprojects.collect { prj ->
+      prj.tasks.matching { task -> task.name == 'checkBrokenLinks'}
+    }
+  }
+
+  // TODO: uncomment this line after fixing all broken links.
+  // (we can't fix the cross-project links until ant build is disabled.)
+  // check.dependsOn documentationLint
+}
+
+configure(subprojects.findAll { it.path in [':lucene', ':solr'] }) {
+  task checkBrokenLinks(type: CheckBrokenLinksTask)
+}
+
+class CheckBrokenLinksTask extends DefaultTask {
+  @Input
+  File docsDir = project.docroot

Review comment:
       See b7c60e53eb8d7c7c01ccd7c00add2662e503fd08




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


[GitHub] [lucene-solr] mocobeta commented on a change in pull request #1522: LUCENE-9374: Add doclumentationLint gradle task

Posted by GitBox <gi...@apache.org>.
mocobeta commented on a change in pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#discussion_r426144370



##########
File path: gradle/validation/documentation-lint.gradle
##########
@@ -0,0 +1,65 @@
+/*
+ * 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) {
+
+  task documentationLint {
+    group 'Verification'
+    description 'Verify all documentation'
+
+    dependsOn 'documentation'
+    dependsOn subprojects.collect { prj ->
+      prj.tasks.matching { task -> task.name == 'checkBrokenLinks'}
+    }
+  }
+
+  // TODO: uncomment this line after fixing all broken links.

Review comment:
       Removed this, instead I added "check.dependsOn checkBrokenLinks".




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


[GitHub] [lucene-solr] uschindler commented on a change in pull request #1522: LUCENE-9374: Add checkBrokenLinks gradle task

Posted by GitBox <gi...@apache.org>.
uschindler commented on a change in pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#discussion_r426715844



##########
File path: gradle/validation/check-broken-links.gradle
##########
@@ -0,0 +1,68 @@
+/*
+ * 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) {
+
+  task checkBrokenLinks {
+    group 'Verification'
+    description 'Check broken links in the entire documentation'
+
+    dependsOn ':lucene:checkBrokenLinks'
+    dependsOn ':solr:checkBrokenLinks'
+  }
+
+}
+configure(subprojects.findAll { it.path in [':lucene', ':solr'] }) {
+
+  task checkBrokenLinks(type: CheckBrokenLinksTask, 'dependsOn': 'documentation')
+
+  // TODO: uncomment this line after fixing all broken links.
+  // (we can't fix the cross-project links until ant build is disabled.)
+  // check.dependsOn checkBrokenLinks
+}
+
+class CheckBrokenLinksTask extends DefaultTask {
+
+  @Input
+  Provider<File> docsDir = project.providers.provider { project.docroot }
+
+  @Input

Review comment:
       same here




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


[GitHub] [lucene-solr] uschindler commented on a change in pull request #1522: LUCENE-9374: Add doclumentationLint gradle task

Posted by GitBox <gi...@apache.org>.
uschindler commented on a change in pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#discussion_r426256449



##########
File path: gradle/validation/documentation-lint.gradle
##########
@@ -0,0 +1,72 @@
+/*
+ * 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) {
+
+  task documentationLint {
+    group 'Verification'
+    description 'Verify all documentation'
+
+    dependsOn ':lucene:checkBrokenLinks'
+    dependsOn ':solr:checkBrokenLinks'
+  }
+}
+
+configure(subprojects.findAll { it.path in [':lucene', ':solr'] }) {
+
+  project.afterEvaluate {
+    task checkBrokenLinks(type: CheckBrokenLinksTask) {
+      docsDir = project.docroot
+      dependsOn subprojects.collect { prj ->

Review comment:
       Thats the IMHO "better" code after #1477 is merged:
   
   `dependsOn "${path}:documentation"` 




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


[GitHub] [lucene-solr] mocobeta commented on pull request #1522: LUCENE-9374: Add checkBrokenLinks gradle task

Posted by GitBox <gi...@apache.org>.
mocobeta commented on pull request #1522:
URL: https://github.com/apache/lucene-solr/pull/1522#issuecomment-629801544


   I changed the top-level 'documentationLint' task name to 'checkBrokenLinks'


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