Hi,

no, javadoc is not able out of the box to generate documentation for several projects in one go. It will on the command line do this for you if you enumerate the list of source directories like in this example [1]:

C:> javadoc -sourcepath C:\user1\src;C:\user2\src com.mypackage

Ant has also a sourcepathref attribute for the javadoc task [2]

so you can define your source path like that :

<path id="allmysources">
  <pathelement location="C:\user1\src"/>
  <pathelement location="C:\user2\src"/>
</path>

<javadoc sourcepathref="allmysources" ....

My guess is the hard part for you will be to create the <path type definition. To make it on the fly dynamically, you could have a script generating the path in its own file. Of course the file created on the fly has to be done before it is needed. Maybe someone has a better idea about that.

Regards,

Antoine


[1] http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/javadoc.html#javadocoptions
[2] http://ant.apache.org/manual/CoreTasks/javadoc.html

Res Pons wrote:
Reposting again.

Shouldn't javadoc automatically recurse through directories? It doesn't for me. I would like to run javadoc at the root of all my projects w/o telling it it each .java file. We have a multi-project platform all residing within a master project and each having their own src subfolder and many .java source files:

MasterProject
 proj1
    -src
 proj2
    -src
 proj3
    -src

The command below, in my original email, does not work for me. But if I generate a for-loop at the DOS prompt from the root of all the projects, I get it to work but the result is is not correct. All the examples out there are geared toward a single project. How can I get javadoc to recurse automatically? I do not see a command line option. Once I successfully run this at the command prompt or from a batch file, I will then convert it to Ant/xml.

Thanks

----Original Message Follows----
From: "Res Pons" <pon...@hotmail.com>
Reply-To: "Ant Users List" <user@ant.apache.org>
To: user@ant.apache.org
Subject: javadoc
Date: Thu, 05 Apr 2007 21:28:18 -0700

Almost wrong forum, I know...but...

I would like to test and run javadoc at a DOS prompt before writing ant code for it but the problem is that when I cd into my project and execute the following, I get an error1 and nothing happens.

c:\>cd Builds\project1
C:\Builds\project1>javadoc -sourcepath widgegts\src:3rdpary\scr *.java -d javadocs

javadoc: error - File not found: "*.java"
1 error

How come javadoc is not recursing through my subfolders?



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org

Reply via email to