One of the first things I did when creating my first build was to create an
'info' task. This outputs the configuration of the build, because as soon as
you add plugins you have available tasks and configs that you haven't
directly declared yourself, i.e. they are added by the plugins.
The only way to see what tasks the plugin has added to your build is to find
documentation / javadoc / source saying so.
An 'info' task added to the java plugin, or made even more primary, would
output usage information for your build, with hooks for adding your own
messages to the info. This task could be a default of defaults. At the
moment, if you run a build which has no default task and you don't specify
one you simply get a message saying that there is no task to run, perhaps it
could by default run the 'info' task.
Or maybe it could be it's own new plugin?
e.g.:
>gradle info
:info
******************************
* * Build config info *
* *********************
* Usage info for build.gradle C:\Work\timreg\build
* All tasks:
* - javadoc
* - archive_war
* - init
* - jettyRun
* - eclipseProject
* - resources
* - eclipseWtpModule
* - libs
* - uploadDists
* - compile
* - testCompile
* - uploadLibs
* - testResources
* - eclipse
* - eclipseWtp
* - jettyRunExploded
* - eclipseCp
* - eclipseClean
* - test
* - upload
* - dists
* - info
* - archive_jar
* - clean
* - uploadInternalLibs
* - jettyStop
* - jettyRunWar
* All configurations:
* - runtime
* - libs
* - compile
* - testCompile
* - testRuntime
* - master
* - providedRuntime
* - default
* - providedCompile
* - dists
******************************
BUILD SUCCESSFUL
Total time: 2.312 secs
build.gradle:
def info(Project projectDef) {
println "******************************"
println "* * Build config info *"
println "* *********************"
println "* Usage info for $projectDef.buildFileName $projectDef.buildDir"
println "* All tasks:"
projectDef.getTasks().each {key, value -> println "* - $key"}
println ""
println "* All configurations:"
projectDef.getDependencies().getConfigurations().each {key, value ->
println "* - $key"}
println "******************************"
println ""
}
createTask('info') {
info(projectDef)
}
but with tasks by plugin, etc etc, i.e. better, obviously ;-)
Does something like this already exist?
--
View this message in context:
http://www.nabble.com/new-%27info%27-or-%27usage%27-task--tp21725577p21725577.html
Sent from the gradle-user mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email