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/06 08:28:05 UTC
[GitHub] [lucene-solr] uschindler opened a new pull request #1488: LUCENE-9321: Refactor renderJavadoc to allow relative links with multiple Gradle tasks
uschindler opened a new pull request #1488:
URL: https://github.com/apache/lucene-solr/pull/1488
This is a WIP task to convert the renderJavadoc task in the Gradle build to run 2 times:
- Once for the Maven artifacts with absolute links (standard "javadoc" gradle task replacement. Output is project local). This task will be used for precommit (limited checks, as cross-module links cannot be checked. This task is for everyday use
- another task that renders all javadocs to the global documentation folder (one for Lucene, one for Solr). All links inside will be relative.
This PR currently contains:
- Refactor task to own class, so we can create multiple named tasks
- Add task property to generate relative links (a new closure was added to do this: It produces a relative link from the Gradle project path of current project to the linked project
----------------------------------------------------------------
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 #1488: LUCENE-9321: Refactor renderJavadoc to allow relative links with multiple Gradle tasks
Posted by GitBox <gi...@apache.org>.
uschindler commented on a change in pull request #1488:
URL: https://github.com/apache/lucene-solr/pull/1488#discussion_r420868795
##########
File path: gradle/render-javadoc.gradle
##########
@@ -430,3 +305,180 @@ configure(subprojects.findAll { it.path in [':solr:solr-ref-guide', ':solr:serve
project.tasks.findByPath("renderJavadoc").enabled = false
}
}
+
+class RenderJavadocTask extends DefaultTask {
+ @InputFiles
+ @SkipWhenEmpty
+ SourceDirectorySet srcDirSet;
+
+ @OutputDirectory
+ File outputDir;
+
+ @InputFiles
+ @Classpath
+ FileCollection classpath;
+
+ @Input
+ boolean linksource = false;
+
+ @Input
+ boolean linkJUnit = false;
+
+ @Input
+ boolean relativeProjectLinks = true;
+
+ @Input
+ def linkProjects = [];
+
+ @Input
+ def luceneDocUrl = project.propertyOrDefault('lucene.javadoc.url', "https://lucene.apache.org/core/${project.baseVersion.replace(".", "_")}")
+
+ @Input
+ def solrDocUrl = project.propertyOrDefault('solr.javadoc.url', "https://lucene.apache.org/solr/${project.baseVersion.replace(".", "_")}")
+
+ @TaskAction
+ public void render() {
+ def thispc = project.path.split(':').drop(1);
+ // Converts absolute project path (e.g., ":lucene:analysis:common") to
+ // a link in the docs; relative to current, if needed for global documentation
+ def convertPath2Link = { path ->
+ def pc = path.split(':').drop(1);
+ if (relativeProjectLinks) {
+ int toDrop = 0;
+ for (int i = 0; i < Math.min(pc.size(), thispc.size()); i++) {
+ if (pc[i] == thispc[i]) {
+ toDrop++;
+ } else {
+ break;
+ }
+ }
+ // only create relative path if there is actually anything removed from beginning (this implies absolute link solr -> lucene):
+ if (toDrop > 0) {
+ return Collections.nCopies(thispc.size() - toDrop, '..').plus(pc.drop(toDrop) as List).join('/').concat('/');
+ }
+ }
+ return "${(pc[0] == 'lucene') ? luceneDocUrl : solrDocUrl}/${pc.drop(1).join('/')}/"
+ }
+
+ // escapes an option with single quotes or whitespace to be passed in the options.txt file for
+ def escapeJavadocOption = { String s -> (s =~ /[ '"]/) ? ("'" + s.replaceAll(/[\\'"]/, /\\$0/) + "'") : s }
+
+ def relativizeURL = { String from, String to ->
+ URI fromUri = URI.create(from).normalize();
+ URI toUri = URI.create(to).normalize();
+ if (fromUri.scheme != toUri.scheme || fromUri.authority != toUri.authority) {
+ return to;
+ }
+ // because URI#relativice can't handle relative paths, we use Path class as workaround
+ Path fromPath = Paths.get("./${fromUri.path}");
+ Path toPath = Paths.get("./${toUri.path}");
+ return fromPath.relativize(toPath).toString().replace(File.separator, '/')
+ }
+
+ def libName = project.path.startsWith(":lucene") ? "Lucene" : "Solr"
+ def title = "${libName} ${project.version} ${project.name} API"
+
+ // absolute urls for "-linkoffline" option
+ def javaSEDocUrl = "https://docs.oracle.com/en/java/javase/11/docs/api/"
+ def junitDocUrl = "https://junit.org/junit4/javadoc/4.12/"
+
+ def javadocCmd = org.gradle.internal.jvm.Jvm.current().getJavadocExecutable()
+
+ def srcDirs = srcDirSet.srcDirs.findAll { dir -> dir.exists() }
+ def optionsFile = project.file("${getTemporaryDir()}/javadoc-options.txt")
+
+ def opts = []
+ opts << [ '-overview', project.file("${srcDirs[0]}/overview.html") ]
+ opts << [ '-sourcepath', srcDirs.join(File.pathSeparator) ]
+ opts << [ '-subpackages', project.path.startsWith(':lucene') ? 'org.apache.lucene' : 'org.apache.solr' ]
+ opts << [ '-d', outputDir ]
+ opts << '-protected'
+ opts << [ '-encoding', 'UTF-8' ]
+ opts << [ '-charset', 'UTF-8' ]
+ opts << [ '-docencoding', 'UTF-8' ]
+ opts << '-noindex'
+ opts << '-author'
+ opts << '-version'
+ if (linksource) {
+ opts << '-linksource'
+ }
+ opts << '-use'
+ opts << [ '-locale', 'en_US' ]
+ opts << [ '-windowtitle', title ]
+ opts << [ '-doctitle', title ]
+ if (!classpath.isEmpty()) {
+ opts << [ '-classpath', classpath.asPath ]
+ }
+ opts << [ '-bottom', "<i>Copyright © 2000-${project.buildYear} Apache Software Foundation. All Rights Reserved.</i>" ]
+
+ opts << [ '-tag', 'lucene.experimental:a:WARNING: This API is experimental and might change in incompatible ways in the next release.' ]
+ opts << [ '-tag', 'lucene.internal:a:NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.' ]
+ opts << [ '-tag', "lucene.spi:t:SPI Name (case-insensitive: if the name is 'htmlStrip', 'htmlstrip' can be used when looking up the service)." ]
+
+ // resolve links to JavaSE and JUnit API
+ opts << [ '-linkoffline', javaSEDocUrl, project.project(':lucene').file('tools/javadoc/java11/') ]
+ if (linkJUnit) {
+ opts << [ '-linkoffline', junitDocUrl, project.project(':lucene').file('tools/javadoc/junit/') ]
+ }
+ // resolve inter-project links
+ linkProjects.collect { path ->
+ def docdir = convertPath2Link(path)
+ logger.warn(docdir as String);
+ opts << [ '-linkoffline', docdir, project.project(path).javadoc.destinationDir ]
Review comment:
Ah thanks. I will look into this. From what I have seen as output the links were generated correctly.
So I will use `-link` if the boolean flag enables relative links, otherwise `-linkoffline`. I will check the ANT task, too.
----------------------------------------------------------------
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 #1488: LUCENE-9321: Refactor renderJavadoc to allow relative links with multiple Gradle tasks
Posted by GitBox <gi...@apache.org>.
dweiss commented on pull request #1488:
URL: https://github.com/apache/lucene-solr/pull/1488#issuecomment-628495567
+1.
----------------------------------------------------------------
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 #1488: LUCENE-9321: Refactor renderJavadoc to allow relative links with multiple Gradle tasks
Posted by GitBox <gi...@apache.org>.
uschindler commented on pull request #1488:
URL: https://github.com/apache/lucene-solr/pull/1488#issuecomment-628558810
I just noticed we have no CHANGES entry for Gradle at all. We should maybe add one for all.
So I will merge this without adding a new changes entry.
----------------------------------------------------------------
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 #1488: LUCENE-9321: Refactor renderJavadoc to allow relative links with multiple Gradle tasks
Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #1488:
URL: https://github.com/apache/lucene-solr/pull/1488#discussion_r421333692
##########
File path: gradle/render-javadoc.gradle
##########
@@ -57,20 +57,11 @@ configure(subprojects.findAll { it.path.startsWith(':lucene') && it.path != ':lu
doLast {
// fix for Java 11 Javadoc tool that cannot handle split packages between modules correctly (by removing all the packages which are part of lucene-core)
// problem description: [https://issues.apache.org/jira/browse/LUCENE-8738?focusedCommentId=16818106&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16818106]
- ant.local(name: "element-list-regex") // contains a regex for all package names which are in lucene-core's javadoc
- ant.loadfile(property: "element-list-regex", srcFile: "${project(':lucene:core').tasks[name].outputDir}/element-list", encoding: "utf-8") {
- filterchain {
- tokenfilter(delimoutput: "|") {
- replacestring(from: ".", to: "\\.")
- }
- }
- }
- ant.replaceregexp(
- encoding: "UTF-8",
- file: "${project.javadoc.destinationDir}/element-list",
- byline: "true",
- match: "^(\${element-list-regex})\$",
- replace: "")
+ Set luceneCorePackages = file("${project(':lucene:core').tasks[name].outputDir}/element-list").readLines('UTF-8').toSet();
+ File elementFile = file("${outputDir}/element-list");
+ List elements = elementFile.readLines('UTF-8');
+ elements.removeAll{ luceneCorePackages.contains(it) }
+ elementFile.write(elements.join('\n').concat('\n'), 'UTF-8');
Review comment:
Nice!
----------------------------------------------------------------
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 #1488: LUCENE-9321: Refactor renderJavadoc to allow relative links with multiple Gradle tasks
Posted by GitBox <gi...@apache.org>.
uschindler commented on pull request #1488:
URL: https://github.com/apache/lucene-solr/pull/1488#issuecomment-628494121
Hi, I did a small change:
The tasks returned by resolving dependencies are *unsorted*. In case of split packages, the results of javadoc execution are therefore not reproducible. I fixed this by applying a sort order:
- first all projects named "core"
- all other projects sorted lexicographical by (task) path
This makes the `-link` parameters (and also the absolute ones) predictable in order and also implements it in the same way like ANT did.
----------------------------------------------------------------
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 #1488: LUCENE-9321: Refactor renderJavadoc to allow relative links with multiple Gradle tasks
Posted by GitBox <gi...@apache.org>.
mocobeta commented on pull request #1488:
URL: https://github.com/apache/lucene-solr/pull/1488#issuecomment-628341858
Looks excellent to me too.
----------------------------------------------------------------
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 #1488: LUCENE-9321: Refactor renderJavadoc to allow relative links with multiple Gradle tasks
Posted by GitBox <gi...@apache.org>.
mocobeta commented on pull request #1488:
URL: https://github.com/apache/lucene-solr/pull/1488#issuecomment-628629711
> Also, thanks for eyeballing the outputs with your keen eye, Tomoko.
If I correctly understand the meaning of the phrase, my fellows occasionally say similar things to me (in Japanese). 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 #1488: LUCENE-9321: Refactor renderJavadoc to allow relative links with multiple Gradle tasks
Posted by GitBox <gi...@apache.org>.
mocobeta commented on a change in pull request #1488:
URL: https://github.com/apache/lucene-solr/pull/1488#discussion_r420737101
##########
File path: gradle/render-javadoc.gradle
##########
@@ -430,3 +305,180 @@ configure(subprojects.findAll { it.path in [':solr:solr-ref-guide', ':solr:serve
project.tasks.findByPath("renderJavadoc").enabled = false
}
}
+
+class RenderJavadocTask extends DefaultTask {
+ @InputFiles
+ @SkipWhenEmpty
+ SourceDirectorySet srcDirSet;
+
+ @OutputDirectory
+ File outputDir;
+
+ @InputFiles
+ @Classpath
+ FileCollection classpath;
+
+ @Input
+ boolean linksource = false;
+
+ @Input
+ boolean linkJUnit = false;
+
+ @Input
+ boolean relativeProjectLinks = true;
+
+ @Input
+ def linkProjects = [];
+
+ @Input
+ def luceneDocUrl = project.propertyOrDefault('lucene.javadoc.url', "https://lucene.apache.org/core/${project.baseVersion.replace(".", "_")}")
+
+ @Input
+ def solrDocUrl = project.propertyOrDefault('solr.javadoc.url', "https://lucene.apache.org/solr/${project.baseVersion.replace(".", "_")}")
+
+ @TaskAction
+ public void render() {
+ def thispc = project.path.split(':').drop(1);
+ // Converts absolute project path (e.g., ":lucene:analysis:common") to
+ // a link in the docs; relative to current, if needed for global documentation
+ def convertPath2Link = { path ->
+ def pc = path.split(':').drop(1);
+ if (relativeProjectLinks) {
+ int toDrop = 0;
+ for (int i = 0; i < Math.min(pc.size(), thispc.size()); i++) {
+ if (pc[i] == thispc[i]) {
+ toDrop++;
+ } else {
+ break;
+ }
+ }
+ // only create relative path if there is actually anything removed from beginning (this implies absolute link solr -> lucene):
+ if (toDrop > 0) {
+ return Collections.nCopies(thispc.size() - toDrop, '..').plus(pc.drop(toDrop) as List).join('/').concat('/');
+ }
+ }
+ return "${(pc[0] == 'lucene') ? luceneDocUrl : solrDocUrl}/${pc.drop(1).join('/')}/"
+ }
+
+ // escapes an option with single quotes or whitespace to be passed in the options.txt file for
+ def escapeJavadocOption = { String s -> (s =~ /[ '"]/) ? ("'" + s.replaceAll(/[\\'"]/, /\\$0/) + "'") : s }
+
+ def relativizeURL = { String from, String to ->
+ URI fromUri = URI.create(from).normalize();
+ URI toUri = URI.create(to).normalize();
+ if (fromUri.scheme != toUri.scheme || fromUri.authority != toUri.authority) {
+ return to;
+ }
+ // because URI#relativice can't handle relative paths, we use Path class as workaround
+ Path fromPath = Paths.get("./${fromUri.path}");
+ Path toPath = Paths.get("./${toUri.path}");
+ return fromPath.relativize(toPath).toString().replace(File.separator, '/')
+ }
+
+ def libName = project.path.startsWith(":lucene") ? "Lucene" : "Solr"
+ def title = "${libName} ${project.version} ${project.name} API"
+
+ // absolute urls for "-linkoffline" option
+ def javaSEDocUrl = "https://docs.oracle.com/en/java/javase/11/docs/api/"
+ def junitDocUrl = "https://junit.org/junit4/javadoc/4.12/"
+
+ def javadocCmd = org.gradle.internal.jvm.Jvm.current().getJavadocExecutable()
+
+ def srcDirs = srcDirSet.srcDirs.findAll { dir -> dir.exists() }
+ def optionsFile = project.file("${getTemporaryDir()}/javadoc-options.txt")
+
+ def opts = []
+ opts << [ '-overview', project.file("${srcDirs[0]}/overview.html") ]
+ opts << [ '-sourcepath', srcDirs.join(File.pathSeparator) ]
+ opts << [ '-subpackages', project.path.startsWith(':lucene') ? 'org.apache.lucene' : 'org.apache.solr' ]
+ opts << [ '-d', outputDir ]
+ opts << '-protected'
+ opts << [ '-encoding', 'UTF-8' ]
+ opts << [ '-charset', 'UTF-8' ]
+ opts << [ '-docencoding', 'UTF-8' ]
+ opts << '-noindex'
+ opts << '-author'
+ opts << '-version'
+ if (linksource) {
+ opts << '-linksource'
+ }
+ opts << '-use'
+ opts << [ '-locale', 'en_US' ]
+ opts << [ '-windowtitle', title ]
+ opts << [ '-doctitle', title ]
+ if (!classpath.isEmpty()) {
+ opts << [ '-classpath', classpath.asPath ]
+ }
+ opts << [ '-bottom', "<i>Copyright © 2000-${project.buildYear} Apache Software Foundation. All Rights Reserved.</i>" ]
+
+ opts << [ '-tag', 'lucene.experimental:a:WARNING: This API is experimental and might change in incompatible ways in the next release.' ]
+ opts << [ '-tag', 'lucene.internal:a:NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.' ]
+ opts << [ '-tag', "lucene.spi:t:SPI Name (case-insensitive: if the name is 'htmlStrip', 'htmlstrip' can be used when looking up the service)." ]
+
+ // resolve links to JavaSE and JUnit API
+ opts << [ '-linkoffline', javaSEDocUrl, project.project(':lucene').file('tools/javadoc/java11/') ]
+ if (linkJUnit) {
+ opts << [ '-linkoffline', junitDocUrl, project.project(':lucene').file('tools/javadoc/junit/') ]
+ }
+ // resolve inter-project links
+ linkProjects.collect { path ->
+ def docdir = convertPath2Link(path)
+ logger.warn(docdir as String);
+ opts << [ '-linkoffline', docdir, project.project(path).javadoc.destinationDir ]
Review comment:
To generate relative links, have you considered to use `-link` (as the original ant task does so) option instead of `-linkoffline` ? The first version of "renderJavadoc" had also used `-link` option with relative file paths before we changed it to absolute urls. (I'm not sure if it makes sense here and have no strong feeling with that, but `-link` seems to be more safe since with the option javadoc tool checks if the files to be linked exist on the local machine.)
----------------------------------------------------------------
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 #1488: LUCENE-9321: Refactor renderJavadoc to allow relative links with multiple Gradle tasks
Posted by GitBox <gi...@apache.org>.
uschindler commented on a change in pull request #1488:
URL: https://github.com/apache/lucene-solr/pull/1488#discussion_r425046908
##########
File path: gradle/render-javadoc.gradle
##########
@@ -151,6 +151,18 @@ class RenderJavadocTask extends DefaultTask {
@Input
def solrDocUrl = project.propertyOrDefault('solr.javadoc.url', "https://lucene.apache.org/solr/${project.baseVersion.replace(".", "_")}")
+
+ /** Utility method to recursively collect all tasks with same name like this one that we depend on */
+ private Set findPreviousRenderTasks() {
Review comment:
Yeah, much better! This name was puzzling me. I'll change!
----------------------------------------------------------------
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 #1488: LUCENE-9321: Refactor renderJavadoc to allow relative links with multiple Gradle tasks
Posted by GitBox <gi...@apache.org>.
uschindler commented on pull request #1488:
URL: https://github.com/apache/lucene-solr/pull/1488#issuecomment-628550661
After comparing outputs I found out that the whole thing only worked with direct dependencies. Of course we rely only on render tasks of directly referenced projects. So `:solr:core` depends on lots of Lucene stuff and all this is rendered before. This setup works perfectly.
But when we add the `-link` the previous code only searched for renderJavadoc tasks that were direct dependenencies. So Solr contribs were not adding all of lucene, because most Solr contribs nly depend on Solr core. Of course the Javadocs were created before, but we missed them.
I added a new method to the task, that finds all previous render tasks (recursively). The code in the main logic is now also more readable (we just sort the retun value and add links).
Now everything works as expected, I will merge this PR soon. Thanks @dweiss and @mocobeta for help!
----------------------------------------------------------------
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 merged pull request #1488: LUCENE-9321: Refactor renderJavadoc to allow relative links with multiple Gradle tasks
Posted by GitBox <gi...@apache.org>.
uschindler merged pull request #1488:
URL: https://github.com/apache/lucene-solr/pull/1488
----------------------------------------------------------------
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 edited a comment on pull request #1488: LUCENE-9321: Refactor renderJavadoc to allow relative links with multiple Gradle tasks
Posted by GitBox <gi...@apache.org>.
uschindler edited a comment on pull request #1488:
URL: https://github.com/apache/lucene-solr/pull/1488#issuecomment-628494121
Hi, I did a small change:
The tasks returned by resolving dependencies are *unsorted*. In case of split packages, the results of javadoc execution are therefore not reproducible. I fixed this by applying a sort order:
- first all projects named "core"
- all other projects sorted lexicographical by (task) path
This makes the `-link` parameters (and also the absolute ones) predictable in order and also implements it in the same way like ANT did.
See 9308f77 for that.
----------------------------------------------------------------
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 #1488: LUCENE-9321: Refactor renderJavadoc to allow relative links with multiple Gradle tasks
Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #1488:
URL: https://github.com/apache/lucene-solr/pull/1488#discussion_r425045061
##########
File path: gradle/render-javadoc.gradle
##########
@@ -151,6 +151,18 @@ class RenderJavadocTask extends DefaultTask {
@Input
def solrDocUrl = project.propertyOrDefault('solr.javadoc.url', "https://lucene.apache.org/solr/${project.baseVersion.replace(".", "_")}")
+
+ /** Utility method to recursively collect all tasks with same name like this one that we depend on */
+ private Set findPreviousRenderTasks() {
Review comment:
findRenderTasksInDependencies maybe?
----------------------------------------------------------------
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