Skip to content

Commit

Permalink
Don't cross-link between modules for interim snapshot builds. (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
dweiss committed Mar 18, 2021
1 parent 0e24517 commit ca3de30
Show file tree
Hide file tree
Showing 2 changed files with 150 additions and 168 deletions.
35 changes: 9 additions & 26 deletions gradle/documentation/documentation.gradle
Expand Up @@ -17,34 +17,17 @@

configure(rootProject) {
def urlVersion = project.baseVersion.replace('.', '_')
def refguideUrlVersion = project.baseVersion.replaceFirst(/^(\d+)\.(\d+).*$/, '$1_$2')

ext {
if (!skipLucene) {
luceneDocUrl = project.propertyOrDefault('lucene.javadoc.url', {
if (project.version != project.baseVersion) {
// non-release build
new File(project('lucene:documentation').buildDir, 'site').toURI().toASCIIString().minus(~'/$')
} else {
// release build
"https://lucene.apache.org/core/${urlVersion}"
}
}())
} else {
// TODO: The url should be constructed from actual dependency version... but this isn't available
// at evaluation time. it'd have to be a lazy property provider.
//
// There are actually two questions -
// 1) what to do about links to yet-unreleased Lucene versions and
// 2) forgot what the second question was...
//
// For now, just hardcode the latest released version.
// We could download Lucene javadoc artifacts for the actual dependency and just
// link it locally (and publish it on Solr site). This would ensure the docs are always up-to-date,
// even for Lucene snapshots.
luceneDocVersion = "9_0_0-SNAPSHOT"
luceneDocUrl = project.propertyOrDefault('lucene.javadoc.url', "https://lucene.apache.org/core/${luceneDocVersion}")
}
luceneDocUrl = project.propertyOrDefault('lucene.javadoc.url', {
if (project.version != project.baseVersion) {
// non-release build does not cross-link between modules.
return null
} else {
// release build
"https://lucene.apache.org/core/${urlVersion}"
}
}())
}

task documentation() {
Expand Down

0 comments on commit ca3de30

Please sign in to comment.