2019-12-02 09:34:57 -05:00
|
|
|
// Add "help" tasks which display plain text files under 'help' folder.
|
|
|
|
|
|
|
|
configure(rootProject) {
|
|
|
|
def helpFiles = [
|
|
|
|
["Workflow", "help/workflow.txt", "Typical workflow commands."],
|
2019-12-03 03:27:52 -05:00
|
|
|
["Ant", "help/ant.txt", "Ant-gradle migration help."],
|
2019-12-02 09:34:57 -05:00
|
|
|
["Tests", "help/tests.txt", "Tests, filtering, beasting, etc."],
|
2019-12-08 12:34:12 -05:00
|
|
|
["Deps", "help/dependencies.txt", "Declaring, inspecting and excluding dependencies."],
|
2019-12-03 08:40:35 -05:00
|
|
|
["ForbiddenApis", "help/forbiddenApis.txt", "How to add/apply rules for forbidden APIs."],
|
2019-12-08 12:34:12 -05:00
|
|
|
["LocalSettings", "help/localSettings.txt", "Local settings, overrides and build performance tweaks."],
|
2019-12-02 09:34:57 -05:00
|
|
|
]
|
|
|
|
|
|
|
|
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:"
|
2019-12-03 03:27:52 -05:00
|
|
|
helpFiles.each { section, path, sectionInfo ->
|
2019-12-05 05:14:09 -05:00
|
|
|
println String.format(Locale.ROOT,
|
|
|
|
" gradlew :help%-14s # %s", section, sectionInfo)
|
2019-12-02 09:34:57 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-12-03 03:27:52 -05:00
|
|
|
|
|
|
|
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
|
2019-12-02 09:34:57 -05:00
|
|
|
}
|