On Monday 18 March 2002 19:11 pm, John Guthrie wrote: > I want to have a "help" target that will list out all the possible targets > in the build.xml. There are three ways I think I could implement it, from > easiest-and-ugliest getting more elegant (my opinion) but also requiring > more work. Again, suggestions and opinions are welcome.
See the -projecthelp option of ant: ... ant [options] [target [target2 [target3] ...]] Options: ... -projecthelp print project help information > A. just put in a bunch of "echo" tasks stating what I want stated. Makes > for a big ugly target with make this is easily solved with a sed script: help: @echo Please use one of these targets: @sed -n -e '/^#/d;/ /d;s/^\([a-zA-Z]*.*\):.*/\1/p' < Makefile With ant it's a bit more work if you wanna customize it. i'd recommend the -projecthelp, for consistency with other ant projects. > C. write a taskdef that gets an enumeration of all targets in a build.xml > (I figure that is accessible somewhere in ant), >From an Ant task you have full access to the project, tasks, etc. Pretty neat stuff. ----- stephan Generic Universal Computer Guy [EMAIL PROTECTED] - http://www.einsurance.de Office: +49 (89) 552 92 862 Handy: +49 (179) 211 97 67 "I ain't gen'rally given to physicality of that nature but it saves a lot of arguing." -- Nanny Ogg -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>