mirror of https://github.com/apache/lucene.git
43 lines
1.2 KiB
Groovy
43 lines
1.2 KiB
Groovy
// Add "help" tasks which display plain text files under 'help' folder.
|
|
|
|
configure(rootProject) {
|
|
def helpFiles = [
|
|
["Workflow", "help/workflow.txt", "Typical workflow commands."],
|
|
["Ant", "help/ant.txt", "Ant-gradle migration help."],
|
|
["Tests", "help/tests.txt", "Tests, filtering, beasting, etc."],
|
|
]
|
|
|
|
helpFiles.each { section, path, sectionInfo ->
|
|
task "help${section}" {
|
|
group = 'Help (developer guides and hints)'
|
|
description = sectionInfo
|
|
doFirst {
|
|
println "\n" + rootProject.file(path).getText("UTF-8")
|
|
}
|
|
}
|
|
}
|
|
|
|
help {
|
|
doLast {
|
|
println ""
|
|
println "This is an experimental Lucene/Solr gradle build. See some"
|
|
println "guidelines, ant-equivalent commands etc. under help/*; or type:"
|
|
helpFiles.each { section, path, sectionInfo ->
|
|
println " gradlew :help${section} # ${sectionInfo}"
|
|
}
|
|
}
|
|
}
|
|
|
|
task allHelpFilesExit() {
|
|
doFirst {
|
|
helpFiles.each { section, path, sectionInfo ->
|
|
if (!rootProject.file(path).exists()) {
|
|
throw new GradleException("Help file missing: ${path} (correct help.gradle)")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
check.dependsOn allHelpFilesExit
|
|
}
|