I just got into the habit of adding a target to all my build files that does
exactly that. So, for instance, I might have a target like this:

  <target name="targets">
    <echo message=""/>
    <echo message="Ant build for ${Name} ${version}"/>
    <echo message=""/>
    <echo message="The following targets are available:"/>
    <echo message="  targets    Lists the available targets"/>
    <echo message="  clean      Cleans up the build directory"/>
    <echo message="  compile    Compiles Java source files"/>
    <echo message="  jar        Builds the library jar file"/>
    <echo message="  docs       Creates javadocs from the sources"/>
    <echo message="  build      Runs compile and jar"/>
    <echo message="  rebuild    Runs clean, compile and jar"/>
    <echo message="  all        Runs clean, compile, jar and docs"/>
  </target>

If you have targets that you don't want to display, then of course you just
wouldn't add them to the "targets" target.

--
Martin Cooper
Tumbleweed Communications

----- Original Message -----
From: "David Corbin" <[EMAIL PROTECTED]>
To: "Ant User" <[EMAIL PROTECTED]>
Sent: Wednesday, January 10, 2001 4:52 AM
Subject: Want: command line option


> I'd like to see a command line option which simply spits out the targets
> in the build file.  As an extension to this concept, I could see the
> ability to specify (in the build file) that certain targets should NOT
> be shown here.
>
>
> --
> David Corbin
> Mach Turtle Technologies, Inc.
> http://www.machturtle.com
> [EMAIL PROTECTED]


Reply via email to