2020-01-27 12:05:34 -05: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.
|
|
|
|
*/
|
|
|
|
|
2020-01-27 11:29:59 -05:00
|
|
|
// 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."],
|
2020-12-17 07:11:54 -05:00
|
|
|
["Formatting", "help/formatting.txt", "Code formatting conventions."],
|
2020-07-21 03:19:38 -04:00
|
|
|
["Jvms", "help/jvms.txt", "Using alternative or EA JVM toolchains."],
|
2020-01-27 11:29:59 -05:00
|
|
|
["Deps", "help/dependencies.txt", "Declaring, inspecting and excluding dependencies."],
|
|
|
|
["ForbiddenApis", "help/forbiddenApis.txt", "How to add/apply rules for forbidden APIs."],
|
|
|
|
["LocalSettings", "help/localSettings.txt", "Local settings, overrides and build performance tweaks."],
|
|
|
|
["Git", "help/git.txt", "Git assistance and guides."],
|
2020-04-17 20:40:32 -04:00
|
|
|
["ValidateLogCalls", "help/validateLogCalls.txt", "How to use logging calls efficiently."],
|
2020-08-21 15:47:11 -04:00
|
|
|
["IDEs", "help/IDEs.txt", "IDE support."],
|
2021-01-26 10:22:50 -05:00
|
|
|
["Docker", "solr/docker/gradle-help.txt", "Building Solr Docker images."],
|
2020-01-27 11:29:59 -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:"
|
2020-09-06 17:15:56 -04:00
|
|
|
println ""
|
2020-01-27 11:29:59 -05:00
|
|
|
helpFiles.each { section, path, sectionInfo ->
|
|
|
|
println String.format(Locale.ROOT,
|
2020-04-17 20:40:32 -04:00
|
|
|
" gradlew :help%-16s # %s", section, sectionInfo)
|
2020-01-27 11:29:59 -05:00
|
|
|
}
|
2020-09-06 17:15:56 -04:00
|
|
|
println ""
|
|
|
|
println "For the impatient, build the project with 'gradlew assemble' or 'gradlew dev' "
|
2020-01-27 11:29:59 -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
|
|
|
|
}
|