You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Nathan Fiedler <nf...@bluemarsh.com> on 2000/08/14 09:24:05 UTC

how to use javadoc task

I've got code in /home/nfiedler/java/com/bluemarsh/jswat that I want to run
javadoc on, using Ant. So I try something like:

< javadoc sourcepath="/home/nfiedler/java" destdir="apidist"
          packagenames="com.bluemarsh.jswat.*"/>

This is apparently the only way I can get javadoc to work from within Ant. This
has two problems.

1. Using /home/nfiedler/java as the sourcepath means that the javadoc task
   tries to read the java files in that directory, which is not my intention.
   I only want to document the code in /home/nfiedler/java/com/bluemarsh/jswat.
2. Using /home/nfiedler/java is not portable and is unacceptable to me. I would
   much prefer using a reasonable argument such as "." when running Ant from
   /home/nfiedler/java/com/bluemarsh/jswat.

My thinking is the sourcepath attribute to javadoc should be made optional.
Without the -sourcepath option javadoc will still find the packages by using the
classpath environment variable. That would be the ideal solution for me.

nathan

RE: how to use javadoc task

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
Nathan,

For the packagenames="com.bluemarsh.jswat.*" construct to work, the ant
javadoc task must read the source. This is the reason sourcepath is
required. Normally javadoc, the tool, requires you to be explicit about
which packages to use, which can be tedious.  When I use sourcepath,
however, I use a relative directory without problems.

Are you running ant from /home/nfiedler/java/com/bluemarsh/jswat as you
mention in point 2? If so, that may be part of your problem. Normally I
would expect a setup something like running ant from /home/nfiedler and
setting sourcepath to "java".

Conor

> -----Original Message-----
> From: nfiedler@bluemarsh.com [mailto:nfiedler@bluemarsh.com]
> Sent: Monday, 14 August 2000 17:24
> To: ant-user@jakarta.apache.org
> Subject: how to use javadoc task
>
>
> I've got code in /home/nfiedler/java/com/bluemarsh/jswat that I
> want to run
> javadoc on, using Ant. So I try something like:
>
> < javadoc sourcepath="/home/nfiedler/java" destdir="apidist"
>           packagenames="com.bluemarsh.jswat.*"/>
>
> This is apparently the only way I can get javadoc to work from
> within Ant. This
> has two problems.
>
> 1. Using /home/nfiedler/java as the sourcepath means that the javadoc task
>    tries to read the java files in that directory, which is not
> my intention.
>    I only want to document the code in
> /home/nfiedler/java/com/bluemarsh/jswat.
> 2. Using /home/nfiedler/java is not portable and is unacceptable
> to me. I would
>    much prefer using a reasonable argument such as "." when
> running Ant from
>    /home/nfiedler/java/com/bluemarsh/jswat.
>
> My thinking is the sourcepath attribute to javadoc should be made
> optional.
> Without the -sourcepath option javadoc will still find the
> packages by using the
> classpath environment variable. That would be the ideal solution for me.
>
> nathan
>