Submitted On 14-JAN-1998
reichel
The current behavior is inconvenient. But for know
you can work-around this by specifying each package
on the command line.
i.e. javadoc -d <docdir> Halifax Halifax.General Halifax.General.HxDate
...
Submitted On 06-FEB-1998
engines
I'd rather see this as an optional flag. Current implementation allows you to
have sub-packages which are not exposed to your customer which I like. I'd
like to have a -r flag to process recursively or something.
Submitted On 10-FEB-1998
mark_lindner
This is especially annoying under crappy operating systems like
WinNT which limit the length of a command line to about 256 characters.
Not very useful when you are generating javadoc for a long list of
packages with a command whose length exceeds this limit.
Submitted On 02-MAR-1998
tdibble1
As for excluding sub-packages, I like the way PolarDoc implements this; it
defaults to including all subdirs, and you may use the -x mypackage switch to
exclude packages you don't want javadoc'd.
Well, for that matter, JavaSoft could learn quite a bit from PolarDoc!
Submitted On 11-MAY-1998
grohoski
This code will generate the javadoc for large packages which extend beyond the
256 character maximums on win32 systems:
It also redirects the output to a file for perusal since the command line
prompt is not scrollable on win32 systems.
Just include your options in the array as below:
import sun.tools.javadoc.*;
import java.io.*;
public class generateDocs
{
public static final String myPackages[] = {
"-version",
"-author",
"-private",
"mypackage",
"mypackage.subpackage",
"mypackage.subpackage2",
"mypackage2.subpackage",
"mypackage2.subpackage2"
};
public static void main(String[] args)
{
for(int i = 0; i < 10; i++)
{
generateDocs.doYourStuff();
}
}
public static void doYourStuff()
{
try
{
File outFile = new File("c:\\logs\\javadoc.log");
PrintStream outStream = new PrintStream(new FileOutputStream(outFile));
System.setOut(outStream);
System.out.println("Beginning documentation creation");
sun.tools.javadoc.Main.main(myPackages);
}
catch(IOException e)
{
System.out.println("Error setting stderr");
e.printStackTrace();
}
}
Submitted On 13-MAY-1998
tryphon
I agree with this bug : my application has
186 packages !!! Javadoc is hell for me !!
Another bug : under WinNT the option -J<flag>
doesn't work. With my 911 classes, I must run
"java -mx32m -ms32m sun.tools.javadoc.Main ...".
Submitted On 15-MAY-1998
mbp@pharos.com.au
Please do this with a -recursive option to change
from the normal functionality.
Submitted On 27-MAY-1998
spau008
Hi,
I don't know why this option was never added in the first place.
Seems like just having an option (like "dir /s"in DOS) would have
been common sense.
If you don't want it, don't slash it.
It would be a REAL time saver.
Submitted On 30-JUN-1998
bribass
A recursive flag would greatly simplify javadoc generation for my deeply
packaged classes.
Submitted On 17-JUL-1998
mbells
It would be interesting to be able to specify
either both recursive and non recursive packages
in one command line. Maybe using the syntax:
javadoc <options> package1.* package2 package3.*.*
package1 would include all first level subpackage, and
package2 would include no other subpackage, and
package3 would include all second level subpackages (recurse twice).
This is simple, and like "-r" is similar to command
line shells (replacing "/" with ".", eg. "ls
bin/*/*").
But, this is *much* more powerful.
Submitted On 05-AUG-1998
loverde
The problem with this feature request is figuring
out how to "prune" unwanted packages from the
list. Personally, I use a "ksh" script to generate
a list of package names similar to the following:
***** BEGIN get_javadocdirs SCRIPT *****
#!/ksh
#
# Name: get_javadocdirs
# Usage: get_javadocdirs <sourcepath>
#
# Get a list of the directories, pruning
# the CVS and test subdirectories
cd $1
ALL_PKGDIRS=`find . -name CVS -prune -o -name test -prune -o -type d -print
# Prune any directories that don't contain a java
# file
PKGDIRS=""
for DIR in $ALL_PKGDIRS; do
LSDIR=`ls $DIR/*.java 2> /dev/null`
if [ ! -z "$LSDIR" ]; then
PKGDIRS=`echo $PKGDIRS $DIR`
fi
done
# Convert directory names to package names
#
PKGNAMES=""
for DIR in $PKGDIRS; do
PKGNAME=`echo $DIR | sed -e 's/\.\///g'`
PKGNAME=`echo $PKGNAME | sed -e 's/\//\./g'`
PKGNAMES=`echo $PKGNAMES $PKGNAME`
done
# Return the list of package names
#
echo $PKGNAMES
***** END get_javadocdirs SCRIPT *****
Similar scripts could be written in perl
or the scripting language of your choice. As I
said, perhaps the biggest problem is deciding
how to prune directories from your list of
package names.
Using this script, javadoc generation is simply:
javadoc -d <destdir> `get_javadocdirs <basepath>`
Of course, this is primarily a Unix solution.
However, it will work on Win32 using a Unix toolkit
like the GnuWin32 tools. As for other platforms
(e.g. Mac), I'm not sure what the solution would be.
Submitted On 27-AUG-1998
mcangus
Another possible solution is to allow javadoc to read an ascii file containing
the list of package names. I.e.:
javadoc -d [dest] -f [filename] ...
The input file could be created on Wintel machines using a command like:
"dir /s /aD /b /v * >[filename]"
Then an editor can be used to remove the unwanted packages.
Submitted On 10-NOV-1998
JamesSchriever
Here is an easy work-around on Windows NT using 1.2 beta4 or later:
1. Type the following on the command line from
the root of you packages to get a file
containing a listing of directories:
dir /ad /s /b > packages.txt
2. Then use @packages.txt for your source.
e.g. javadoc @packages.txt
This could be done in one step if javadoc accepted stdin for the files so that
it would have the ability to accept piped input.
e.g. dir /ad /s /b | javadoc
Submitted On 02-DEC-1998
jourdan
It's really painful to not have this -r option !!
Dot it before jdk1.2 last release !!
it's not a hard feature to implement !! Lazy ??
Submitted On 14-JAN-1999
dkramer
Oops, I meant the slashes would have to be changed
to dots.
Submitted On 14-JAN-1999
dkramer
The use of "packages.text" mentioned by James Schreiver,
should work fine. However, his mention of:
dir /ad /s /b | javadoc
would not work as-is (even if Javadoc accepted stdin)
because Javadoc takes package names not directory
names -- the dots would have to be changed to
slashes somehow.
-Doug Kramer
Javadoc team
Submitted On 06-APR-1999
bertlamb
Polardoc kicks Javadoc's ass
Submitted On 20-MAY-1999
aaron_h
Workaround:
On a Windows box, make a batch file in
your source dir like:
dir /a-d /b /s *.java > ~files
javadoc -d ..\doc @~files
del ~files
You might modify this to take a source dir as a parameter.
This simply generates a file listing to be fed into javadoc.
In any case, if this is done you still won't get any package
documentation as described in:
4214962
Synopsis
No package info generated for source files passed on command line
Submitted On 03-NOV-1999
dkf
Surely the way to handle pulling the directories to parse on
the command line is to have the "filename" - be mapped to
reading from System.in (many Unix tools do just this) so the
following command line would do the trick...
dir /ad /s /b | javadoc @-
Well, except for the required filter (producing the following
Solaris command line...)
find hierRoot -type d -print | sed s,/,.,g | javadoc @-
As it is, at the moment I have a *really* crufty shell-script to
handle all this for me which also requires manual maintenance.
Anything that lets me get away from that is deeply welcome!
Submitted On 25-JAN-2000
annehj
Should be obvious
Submitted On 06-APR-2000
jhitt
This would be very convenient - Right now I have to
maintain a separate batch program with all the package
names. I agree it should be a -r (or -s) option. In order
to implement this, I think the java.lang.Package class
might need a method like: public Package[]
Package.getSubpackages(), or some other way to traverse the
package tree via reflection.
Submitted On 25-OCT-2000
laurentcaillette
I do like the way Javadoc handles a list of packages, through the use of @package-list parameter. Many of
my packages have a "test" subpackage, which should not pollute my documentation.
My personal opinion is that a package name should support the asterisk wildcard ('*'), in order to say that
subpackages should be added.
Submitted On 12-APR-2001
stefanreich
Ant, a tool for automating build processes, has a "javadoc"
command that does the job nicely. I often create an ant-
build.xml for projects just for generating javadocs.
Here's the URL:
http://jakarta.apache.org/ant/
Submitted On 19-APR-2001
diroussel
I also use Jakarta Ant to build my javadoc. I reckomend it
to everyone.
Submitted On 27-SEP-2001
richwilsonaus
Under Windows 2000 (and possibly NT) you can use:
dir /b /s *.java > files.txt
to generate a list of files in a directory.
PLEASE NOTE: JDK6 is formerly known as Project Mustang
|