You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by JS developer <js...@rediffmail.com> on 2005/07/12 19:43:09 UTC

build.xml for javadoc of entire folder tree

hi, 
i'm a beginner with ant, i want to generate the javadoc for the entire src.zip that comes with the sun jdk download. I've tried a lot of standard options with the build.xml, sourcepathref, filesets etc. but i get "build failed". Also, it tries to add all the .java source files to the javadoc command in one single command, naturally, the command exceeds the command buffer and fails. Can anyone suggest a url or tutorial to make ant perform a task iteratively on every sub folder and every sub-sub folder etc. by just specifying the top folder name. I also tried eclipse, but mysteriously, the tree view in its  export wizard does not show the source folders which it should - eclipse users will know - others ignore.

Thanks in advance,
JS

Re: build.xml for javadoc of entire folder tree

Posted by Ivan Ivanov <ra...@yahoo.com>.
Hello,

--- JS developer <js...@rediffmail.com> wrote:

> hi, 
> i'm a beginner with ant, i want to generate the
> javadoc for the entire src.zip that comes with the
> sun jdk download. 
Quite an ambitious undertaking :). Why don't you just
download it from[1]. Anyway, it you want it for
educational purposes, here are some guideliness:
0) Read <javadoc> task documentation[2]
1) <javadoc> task will (in this case) a very long
command line, that might exceeed the maximal command
line length for some OS. If so, use useexternalfile
attribute of <javadoc> task
2) It will definitely consume a great deal with memory
so you should increase the maximum heap size using
ANT_OPTS environement variable[3]. In fact, I run the
following snippet with 512m heap size and it fails
with an OutOfMemoryError:
<javadoc author="yes"
  destdir="C:\\j2sdk1.4.2_03\\javadocs"
  useexternalfile="true"
  package="yes">
  <fileset dir="C:\\j2sdk1.4.2_03\\src">
    <include name="**/*.java"/>
  </fileset>
</javadoc>

Regards
Ivan

[1]http://java.sun.com/j2se/1.5.0/download.jsp
[2]http://ant.apache.org/manual/CoreTasks/javadoc.html
[3]http://ant.apache.org/manual/running.html#envvars
> 
> Thanks in advance,
> JS



		
____________________________________________________
Sell on Yahoo! Auctions – no fees. Bid on great items.  
http://auctions.yahoo.com/

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


RE: build.xml for javadoc of entire folder tree

Posted by Bill Rich <br...@webmethods.com>.
Here is a target that does the entire tree beginning at ${src.dir}. It
includes all the files in the directories that begin with the
${pkg.base.dir} directory. The classpath.javadoc property is set in the init
target and is shown following the javadoc target.

If you fiddle around with this you can probably make it work for your case.

<target name="javadoc"
  depends="init"
  description="Produces the API documentation files in JavaDoc format for
all the G11NToolKit classes.">
  <mkdir dir="${doc.dir}"/>
  <delete dir="${doc.dir.javadoc}"/>
  <javadoc destdir="${doc.dir.javadoc}"
    private="true"
    author="true"
    version="true"
    use="true"
    windowtitle="G11N Tool Kit"
    Overview="${src.dir}/overview.html">
    <packageset dir="${src.dir}"
      defaultexcludes="yes">
      <include name="${pkg.base.dir}/**" />
      <exclude name="${src.parser}/java/javacc-3.2/**"/>
      <exclude name="${src.parser}/html/nekohtml-0.9.3/**"/>
      <exclude name="${src.parser}/html/nekohtml-0.9.4/**"/>
      <exclude name="${src.parser}/html/Test/**"/>
    </packageset>
    <classpath refid="classpath.javadoc"/>
  </javadoc>
</target> 

<!-- A class path for the JavaDoc compiler. -->
<path id="classpath.javadoc">
  <fileset dir="./${src.lib}">
    <include name="**/*.jar"/>
    <include name="**/*.zip"/>
  </fileset>
  <fileset dir="${env.ANT_HOME}/lib">
    <include name="**/*.jar"/>
  </fileset>
</path>

HTH Bill

-----Original Message-----
From: JS developer [mailto:js_dev@rediffmail.com] 
Sent: Tuesday, July 12, 2005 10:43 AM
To: user@ant.apache.org
Subject: build.xml for javadoc of entire folder tree

hi,
i'm a beginner with ant, i want to generate the javadoc for the entire
src.zip that comes with the sun jdk download. I've tried a lot of standard
options with the build.xml, sourcepathref, filesets etc. but i get "build
failed". Also, it tries to add all the .java source files to the javadoc
command in one single command, naturally, the command exceeds the command
buffer and fails. Can anyone suggest a url or tutorial to make ant perform a
task iteratively on every sub folder and every sub-sub folder etc. by just
specifying the top folder name. I also tried eclipse, but mysteriously, the
tree view in its  export wizard does not show the source folders which it
should - eclipse users will know - others ignore.

Thanks in advance,
JS



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