• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

generate javadoc dynamicly

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there any way I can generate a javadoc over all sources which are in different subdirectory of a rootpath.
The problem is that the name of the subdirectories are not static. only the rootpath is static.
Is there any way that javadoc seeks automaticly for all sources in the subdirectories???
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you're in a unix environment you can do this with a little shell-magic.
something like:
 
Mathias Andrae
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
and any idea for win nt???
 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If your using the Apache Ant build tool this is a predefined task and is easy to build into your build file.
Even if your using another build process it would be pretty quick to write a Ant file that would generate all your Javadocs. The ant javadoc facility will generate the javadocs for all source files beneath a root directory.......
John
 
Mathias Andrae
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for this great idea. it works...
...but in some cases I got following exception:
[javadoc] Building tree for all the packages and classes...
[javadoc] Building index for all the packages and classes...
[javadoc] Building index for all classes...
[javadoc] javadoc: In doclet class com.sun.tools.doclets.standard.Standard, method start has thrown an exception java
.lang.reflect.InvocationTargetException

[javadoc] java.lang.NullPointerException
[javadoc] at java.util.zip.ZipFile.getInputStream(ZipFile.java:176)
[javadoc] at com.sun.tools.javadoc.PackageDocImpl.documentation(PackageDocImpl.java:76)
[javadoc] at com.sun.tools.javadoc.DocImpl.comment(DocImpl.java:77)
[javadoc] at com.sun.tools.javadoc.DocImpl.tags(DocImpl.java:107)
[javadoc] at com.sun.tools.doclets.standard.HtmlStandardWriter.serialDocInclude(HtmlStandardWriter.java:1381)
[javadoc] at com.sun.tools.doclets.standard.HtmlStandardWriter.serialInclude(HtmlStandardWriter.java:1362)
[javadoc] at com.sun.tools.doclets.standard.tags.SeeTaglet.toString(SeeTaglet.java:105)
[javadoc] at com.sun.tools.doclets.standard.HtmlStandardWriter.generateTagInfo(HtmlStandardWriter.java:1494)
[javadoc] at com.sun.tools.doclets.standard.ClassWriter.generateClassFile(ClassWriter.java:234)
[javadoc] at com.sun.tools.doclets.standard.ClassWriter.generate(ClassWriter.java:95)
[javadoc] at com.sun.tools.doclets.standard.Standard.generateClassCycle(Standard.java:245)
[javadoc] at com.sun.tools.doclets.standard.Standard.generateClassFiles(Standard.java:195)
[javadoc] at com.sun.tools.doclets.standard.Standard.startGeneration(Standard.java:166)
[javadoc] at com.sun.tools.doclets.standard.Standard.start(Standard.java:44)
[javadoc] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[javadoc] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[javadoc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[javadoc] at java.lang.reflect.Method.invoke(Method.java:324)
[javadoc] at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:196)
[javadoc] Generating C:\andrae\destdir\_0002fnve_0002ejspnve_jsp_0.html...
[javadoc] 1 error
[javadoc] at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:95)
[javadoc] at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:288)
[javadoc] at com.sun.tools.javadoc.Start.begin(Start.java:114)
[javadoc] 100 warnings
[javadoc] at com.sun.tools.javadoc.Main.execute(Main.java:44)
[javadoc] at com.sun.tools.javadoc.Main.main(Main.java:34)
BUILD SUCCESSFUL
................
then I got only the tree but not the javadocs of the classes.

any idea why???
 
John Ryan
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mathias,
I havent seen this before so i dont know. Given that its a null pointer exception is it possible that you have not set one of the necessary attributes in the javadoc task. Have you set a value for the destination directory attribute??
John
 
Mathias Andrae
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think all necessary attributes are set.
It is really confusing. the call runs perfectly on most directories. but on some I get this exception.
And I can't find the difference.
Do you know any naturally limits of javadoc?
Here is my build.xml of ant. Maybe you see a mistake. The source and destination dir are set correct in the original version.
<?xml version="1.0"?>
<project name="tutorial" default="build" basedir=".">
<target name="build">

<javadoc
packagenames="*"
destdir="---destination dir---"
author="true"
windowtitle="API"
version="true">

<fileset dir="---source dir---" defaultexcludes ="yes">
<include name="**/*.java"/>
</fileset>
</javadoc>
</target>
</project>
 
John Ryan
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well rather than using the fileset option it might be worth trying out the sourcepath option to specify the location of your files. Im not sure if it will make a difference but give it a shot
 
Pay attention! Tiny ad!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic