The moose likes Ant, Maven and Other Build Tools and the fly likes generating javadoc with ant Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Reply Bookmark "generating javadoc with ant" Watch "generating javadoc with ant" New topic
Author

generating javadoc with ant

madhav srimadh
Greenhorn

Joined: Apr 02, 2004
Posts: 4
Hi:
I am trying to generate javadocs using ant task "javadoc". Even though I explicitly say include only the specified files, the javadoc goes and includes every java file in that directory. Can someone tell me what I am missing?
<javadoc
destdir="docs/dummy"
author="true"
version="true"
use="false"
windowtitle="CO2 API">
<fileset dir="${projdir}" defaultexcludes="yes">
<include name="common/policy/common/PolicyModule.java" />
<include name="common/policy/common/PolicyModuleImpl.java" />
<include name="common/policy/common/RequestHandle.java" />
</fileset>
<doctitle><![CDATA[<h1>documentation</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright © 2004 abc Inc. All Rights Reserved.</i>]]></bottom>
</javadoc>
Thanks,
--MS
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9001
I believe the default is to include all files ending in .java in the fileset unless you explicitly exclude them. Perhaps you could put the files you want into a separate directory?


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
madhav srimadh
Greenhorn

Joined: Apr 02, 2004
Posts: 4
Originally posted by Marilyn de Queiroz:
I believe the default is to include all files ending in .java in the fileset unless you explicitly exclude them. Perhaps you could put the files you want into a separate directory?

I think you are right in that the default for fileset is to include all .java files if not explicitly excluded. I even tried explicitly
excluding the files, the javadoc only loads the included files but
when it is creating the javadoc tree it starts to look at the rest
of the .java files (the ones that I have excluded).
I think this is a bug in the javadoc task, not sure if it's an open bug!
--MS
madhav srimadh
Greenhorn

Joined: Apr 02, 2004
Posts: 4
I have finally figured it out, the problem was with the fileset dir field. I initially had it as the project root, when I changed it to the src root it all works just fine!
A snippet of the build file that does the job follows :
<?xml version ="1.0" encoding = "UTF-8" ?>
<!DOCTYPE doc_build>
<project name="documentation" default="doc" basedir=".">
<description>
co2 doc build file
</description>
<!-- set global properties for this build -->
<property environment="env" />
<property name="srcdir" value="${env.CO2ROOT}/com/abc/co2" />
<target name="doc"
description="generate documentation from the sources " >
<javadoc
destdir="dummy"
author="true"
version="true"
use="false"
windowtitle="CO2 API" >
<fileset dir="${srcdir}" defaultexcludes="yes">
<include name="common/appmgr/*.java" />
<exclude name="common/appmgr/Security.java" />
</fileset>
<doctitle><![CDATA[<h1>Content Over Optics Documentation</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright © 2004 ABC Inc. All Rights Reserved.</i>]]></bottom>
</javadoc>
</target>
</project>
 
 
subject: generating javadoc with ant
 
Threads others viewed
[Ant + Eclipse R2.0] NullPointerException accessing environment
Generating JavaDocs with ANT
Ant - javadoc not finding external links
Error running ant script file.
in javadoc index page no display doctitle
IntelliJ Java IDE