2020-04-30 04:21:53 -04:00
|
|
|
/*
|
|
|
|
* 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) {
|
2020-05-17 08:46:26 -04:00
|
|
|
def urlVersion = project.baseVersion.replace('.', '_')
|
|
|
|
def refguideUrlVersion = project.baseVersion.replaceFirst(/^(\d+)\.(\d+).*$/, '$1_$2')
|
2020-07-27 19:04:21 -04:00
|
|
|
|
2020-05-17 08:46:26 -04:00
|
|
|
ext {
|
2020-07-27 19:04:21 -04:00
|
|
|
luceneDocUrl = project.propertyOrDefault('lucene.javadoc.url', {
|
|
|
|
if (project.version != project.baseVersion) {
|
|
|
|
// non-release build
|
2020-10-09 08:56:44 -04:00
|
|
|
new File(project('lucene:documentation').buildDir, 'site').toURI().toASCIIString().minus(~'/$')
|
2020-07-27 19:04:21 -04:00
|
|
|
} else {
|
|
|
|
// release build
|
|
|
|
"https://lucene.apache.org/core/${urlVersion}"
|
|
|
|
}
|
|
|
|
}())
|
|
|
|
|
|
|
|
solrDocUrl = project.propertyOrDefault('solr.javadoc.url', {
|
|
|
|
if (project.version != project.baseVersion) {
|
|
|
|
// non-release build
|
2020-10-09 08:56:44 -04:00
|
|
|
new File(project('solr:documentation').buildDir, 'site').toURI().toASCIIString().minus(~'/$')
|
2020-07-27 19:04:21 -04:00
|
|
|
} else {
|
|
|
|
// release build
|
|
|
|
"https://lucene.apache.org/solr/${urlVersion}"
|
|
|
|
}
|
|
|
|
}())
|
|
|
|
|
2020-05-17 08:46:26 -04:00
|
|
|
solrRefguideUrl = project.propertyOrDefault('solr.refguide.url', "https://lucene.apache.org/solr/guide/${refguideUrlVersion}")
|
|
|
|
}
|
|
|
|
|
2020-04-30 04:21:53 -04:00
|
|
|
task documentation() {
|
|
|
|
group = 'documentation'
|
|
|
|
description = 'Generate all documentation'
|
|
|
|
|
2020-10-09 08:56:44 -04:00
|
|
|
dependsOn ':lucene:documentation:assemble'
|
|
|
|
dependsOn ':solr:documentation:assemble'
|
2020-04-30 04:21:53 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-14 07:16:16 -04:00
|
|
|
// docroot will point to Lucene and Solr relative directory for each sub-project.
|
2020-10-09 08:56:44 -04:00
|
|
|
configure(subprojects.findAll { it.path == ':lucene:documentation' || it.path == ':solr:documentation' }) {
|
|
|
|
|
2020-04-30 04:21:53 -04:00
|
|
|
ext {
|
2020-10-09 08:56:44 -04:00
|
|
|
docroot = file("${buildDir}/site")
|
|
|
|
docrootMinimal = file("${buildDir}/minimalSite")
|
2020-10-08 15:25:51 -04:00
|
|
|
|
2020-10-09 08:56:44 -04:00
|
|
|
markdownSrc = file("src/markdown")
|
|
|
|
assets = file("src/assets")
|
2020-10-08 15:25:51 -04:00
|
|
|
}
|
2020-10-09 08:56:44 -04:00
|
|
|
|
2020-05-17 08:46:26 -04:00
|
|
|
task documentation() {
|
|
|
|
group = 'documentation'
|
|
|
|
description = "Generate ${project.name.capitalize()} documentation"
|
|
|
|
|
2020-10-09 08:56:44 -04:00
|
|
|
dependsOn project.parent.subprojects.collect { prj ->
|
2020-05-17 08:46:26 -04:00
|
|
|
prj.tasks.matching { it.name == 'renderSiteJavadoc' }
|
|
|
|
}
|
|
|
|
dependsOn 'changesToHtml','copyDocumentationAssets',
|
|
|
|
'markdownToHtml','createDocumentationIndex'
|
|
|
|
}
|
|
|
|
|
|
|
|
task copyDocumentationAssets(type: Copy) {
|
|
|
|
includeEmptyDirs = false
|
2020-10-09 08:56:44 -04:00
|
|
|
from(project.assets)
|
2020-05-17 08:46:26 -04:00
|
|
|
into project.docroot
|
|
|
|
}
|
2020-10-09 08:56:44 -04:00
|
|
|
|
|
|
|
assemble {
|
|
|
|
dependsOn documentation
|
|
|
|
}
|
2020-10-08 15:25:51 -04:00
|
|
|
|
2020-10-09 08:56:44 -04:00
|
|
|
configurations {
|
|
|
|
site
|
|
|
|
}
|
|
|
|
|
2020-10-08 15:25:51 -04:00
|
|
|
artifacts {
|
2020-10-09 08:56:44 -04:00
|
|
|
site project.docroot, {
|
2020-10-08 15:25:51 -04:00
|
|
|
builtBy documentation
|
|
|
|
}
|
|
|
|
}
|
2020-10-09 08:56:44 -04:00
|
|
|
|
2020-05-17 08:46:26 -04:00
|
|
|
}
|
|
|
|
|
2020-10-09 08:56:44 -04:00
|
|
|
configure(project(':solr:documentation')) {
|
2020-05-17 08:46:26 -04:00
|
|
|
|
2020-10-09 08:56:44 -04:00
|
|
|
task documentationMinimal() {
|
2020-10-08 15:25:51 -04:00
|
|
|
group = 'documentation'
|
|
|
|
description = "Generate stub Solr documentation pointing to web page (that's part of Solr TGZ)"
|
2020-10-09 08:56:44 -04:00
|
|
|
dependsOn 'copyMiniDocumentationAssets','createMiniDocumentationIndex','copyChangesToHtmlForMiniSite'
|
2020-10-08 15:25:51 -04:00
|
|
|
}
|
2020-10-09 08:56:44 -04:00
|
|
|
|
|
|
|
task copyChangesToHtmlForMiniSite(type: Copy) {
|
2020-10-08 15:25:51 -04:00
|
|
|
from project.docroot
|
2020-10-09 08:56:44 -04:00
|
|
|
into project.docrootMinimal
|
2020-10-08 15:25:51 -04:00
|
|
|
include 'changes/**'
|
|
|
|
dependsOn 'changesToHtml'
|
2020-05-17 08:46:26 -04:00
|
|
|
}
|
2020-10-09 08:56:44 -04:00
|
|
|
|
|
|
|
task copyMiniDocumentationAssets(type: Copy) {
|
2020-05-17 08:46:26 -04:00
|
|
|
includeEmptyDirs = false
|
2020-10-09 08:56:44 -04:00
|
|
|
from('src/assets')
|
|
|
|
into project.docrootMinimal
|
2020-05-17 08:46:26 -04:00
|
|
|
}
|
2020-10-08 15:25:51 -04:00
|
|
|
|
2020-10-09 08:56:44 -04:00
|
|
|
assemble {
|
|
|
|
dependsOn documentationMinimal
|
|
|
|
}
|
|
|
|
|
|
|
|
configurations {
|
|
|
|
minimalSite
|
|
|
|
}
|
|
|
|
|
2020-10-08 15:25:51 -04:00
|
|
|
artifacts {
|
2020-10-09 08:56:44 -04:00
|
|
|
minimalSite project.docrootMinimal, {
|
|
|
|
builtBy documentationMinimal
|
2020-10-08 15:25:51 -04:00
|
|
|
}
|
|
|
|
}
|
2020-10-09 08:56:44 -04:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
configure(subprojects.findAll { it.path == ':lucene' || it.path == ':solr' }) {
|
|
|
|
|
|
|
|
ext {
|
|
|
|
docroot = project('documentation').docroot
|
|
|
|
docrootMinimal = project('documentation').docrootMinimal
|
|
|
|
}
|
|
|
|
|
2020-04-30 04:21:53 -04:00
|
|
|
}
|