ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Ant design question(s) - #2
Date Mon, 18 Mar 2002 18:28:54 GMT

1) Put your properties in a file called '' (or
      and then have all of your build files reference it using

      <property file="" />

      in each build file.  Be careful, though, because if you write it like
      I just did, ANT will look for a file called ""
      the same directory as the build file it's currently processsing,
      is probably not what you want.  We have defined a ROOTDIR
      property in out ANT wrapper, so that we may then specify

      <property file="${ROOTDIR}/" />

      and ANT looks in the right place.

2) You don't need to do this, such a thing already exists.  Enter

      ant -projecthelp

      to see a list of all valid targets.  (However, I just tried it on a
      which contains a custom task, and I got a nasty message insisting
      the class corresponding to the task couldn't be found.  Hmmm).


                      "Guthrie, John"                                                    
                      <        To:       "Ant Users List (E-mail)" <>
                      >                        cc:                                    
                                               Subject:  Ant design question(s) - #2     
                      03/18/2002 12:11                                                   
                      Please respond to                                                  
                      "Ant Users List"                                                   

I am converting some old makefile-based builds to ant and I have a couple
design questions... here's the second

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. Ideas are:
  A. just put in a bunch of "echo" tasks stating what I want stated. Makes
for a big ugly target
  B. put help info in a separate file and write a "cat" taskdef (couldn't
find one in my ant distro, 1.4.1) that cat's it out. build.xml looks much
  C. write a taskdef that gets an enumeration of all targets in a build.xml
(I figure that is accessible somewhere in ant), maybe matches up targets
with a property file of explanations and generates a help statement from
that (targets that are not in the prop file get listed with no
This one is obviously a bit more work.


john guthrie
american institutes for research

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message