ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Barclay <>
Subject Javadoc: automatically listing all packages?
Date Thu, 26 Apr 2001 20:03:50 GMT

Can Ant's various wildcarding and name-mapping features be combined
to automatically generate a listing of all packages and pass that
list to JavaDoc?  

("All packages" would be the packages implied by all source (sub)directories 
that contain .java files, or possibly all source (sub)directories that
contains .java files or a package.html file (except that the Javadoc command
might complain if there are no .java files).)

The documentation for the "javadoc" task's "packagenames" attribute 

  Comma separated list of package files (with terminating wildcard)

It's not clear whether the javadoc task is supposed to require having
something before the "terminating wildcard".

Trying it reveals strange and probably broken behavior.

If I use sourcepath="src" packagenames="com.*", javadoc finds package
com.myco.util.  (I have a file src/com/myco/util/

However, I use sourcepath="src" packagenames="", javadoc passes "*" to 
Javadoc, which of course causes Javadoc, to try to process everything in 
my base directory.

Why must there be something before the wildcard?  Why can't a user
specify to process all packages?  Is that just a bug, or a bad design

Also, if I try sourcepath="src" packagenames="com.**", javadoc passes
"com.**" to javadoc.  

Why doesn't javadoc interpret "com.*" to match "com.x" and "com.y" but
not "com.x.z", and then use "com.**" to match "com", "com.x", "com.x.z", 
That way, the user would have the same types of options (one level vs. 
multiple levels) as for file names.

Anyway, as to my original question:  

Is there any way to use Ant's directory name wildcarding and file name 
mapping to generate a list of all packages and use that in the javadoc 

If not, is there some way to use those features to generate a package file 
list or a properties file with a property listing all the packages?  

Or do I have to list all top-level package names (e.g., 

Daniel Barclay
Digital Focus

View raw message