lucene/gradle/documentation/documentation.gradle

91 lines
2.5 KiB
Groovy

/*
* 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) {
def urlVersion = project.baseVersion.replace('.', '_')
ext {
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() {
group = 'documentation'
description = 'Generate all documentation'
dependsOn ':lucene:documentation:assemble'
}
assemble.dependsOn documentation
}
// docroot will point to Lucene and Solr relative directory for each sub-project.
configure(project(':lucene:documentation')) {
ext {
docroot = file("${buildDir}/site")
docrootMinimal = file("${buildDir}/minimalSite")
markdownSrc = file("src/markdown")
assets = file("src/assets")
}
task documentation() {
group = 'documentation'
description = "Generate ${project.name.capitalize()} documentation"
dependsOn project.parent.subprojects.collect { prj ->
prj.tasks.matching { it.name == 'renderSiteJavadoc' }
}
dependsOn 'changesToHtml','copyDocumentationAssets',
'markdownToHtml','createDocumentationIndex'
}
task copyDocumentationAssets(type: Copy) {
includeEmptyDirs = false
from(project.assets)
into project.docroot
}
assemble {
dependsOn documentation
}
configurations {
site
}
artifacts {
site project.docroot, {
builtBy documentation
}
}
}
configure(project(":lucene")) {
ext {
docroot = project('documentation').docroot
docrootMinimal = project('documentation').docrootMinimal
}
}