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 2021/03/18 08:55:41 UTC

[GitHub] [lucene] uschindler commented on a change in pull request #21: LUCENE-9849: Don't cross-link between modules for interim snapshot builds.

uschindler commented on a change in pull request #21:
URL: https://github.com/apache/lucene/pull/21#discussion_r596659051



##########
File path: gradle/documentation/render-javadoc.gradle
##########
@@ -377,32 +375,33 @@ class RenderJavadocTask extends DefaultTask {
     // NOTE: explicitly exclude solr/test-framework, or attempting to link to lucene-test-framework because if we did javadoc would
     // attempt to link class refs in in org.apache.lucene, causing broken links. (either broken links to things like "Directory" if
     // lucene-test-framework was first, or broken links to things like LuceneTestCase if lucene-core was first)
-    if (project.path != ':solr:test-framework') {  //
-      findRenderTasksInDependencies()
-          .sort(false, Comparator.comparing { (it.project.name != 'core') as Boolean }.thenComparing(Comparator.comparing { it.path }))
-          .each { otherTask ->
-            def otherProject = otherTask.project
-            // For relative links we compute the actual relative link between projects.
-            def crossLuceneSolr = (otherProject.docroot != project.docroot)
-            if (relativeProjectLinks && !crossLuceneSolr) {
-              def pathTo = otherTask.outputDir.toPath().toAbsolutePath()
-              def pathFrom = outputDir.toPath().toAbsolutePath()
-              def relative = pathFrom.relativize(pathTo).toString().replace(File.separator, '/')
-              opts << ['-link', relative]
-            } else {
-              // For absolute links, we determine the target URL by assembling the full URL.
-              allOfflineLinks.put("${luceneDocUrl}/${otherProject.relativeDocPath}/".toString(), otherTask.outputDir)
+    findRenderTasksInDependencies()
+        .sort(false, Comparator.comparing { (it.project.name != 'core') as Boolean }.thenComparing(Comparator.comparing { it.path }))
+        .each { otherTask ->
+          def otherProject = otherTask.project
+          // For relative links we compute the actual relative link between projects.
+          if (relativeProjectLinks) {
+            def pathTo = otherTask.outputDir.toPath().toAbsolutePath()
+            def pathFrom = outputDir.toPath().toAbsolutePath()
+            def relative = pathFrom.relativize(pathTo).toString().replace(File.separator, '/')
+            opts << ['-link', relative]
+          } else {
+            // For absolute links, we determine the target URL by assembling the full URL (if base is available).
+            def value = luceneDocUrl.getOrElse(null)
+            if (value) {
+              allOfflineLinks.put("${value}/${otherProject.relativeDocPath}/".toString(), otherTask.outputDir)
             }
           }
-    }
-    
+        }
+
     // Add offline links.
     allOfflineLinks.each { url, dir ->
       // Some sanity check/ validation here to ensure dir/package-list or dir/element-list is present.
       if (!project.file("$dir/package-list").exists() &&
           !project.file("$dir/element-list").exists()) {
         throw new GradleException("Expected pre-rendered package-list or element-list at ${dir}.")
       }
+      logger.lifecycle("Linking ${url} to ${dir}")

Review comment:
       I think this should be a lower log level, you used lifecycle to actually see output, right?

##########
File path: gradle/documentation/render-javadoc.gradle
##########
@@ -284,7 +282,8 @@ class RenderJavadocTask extends DefaultTask {
   def offlineLinks = [:]
 
   @Input
-  def luceneDocUrl = "${-> project.luceneDocUrl }"
+  @Optional
+  Property<String> luceneDocUrl = project.objects.property(String)

Review comment:
       How to do this part I was missing yesterday (my javadocs then contained the string "null" as URL..... `Property` is the one I was looking for! Great! Much better than before.




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