You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by William Ferguson <wi...@verveinc.com> on 2000/11/08 08:02:25 UTC

Filesets

OK, I guess I'm doing something really dumb, so I guess you guys will spot
it quickly ..

I am attempting to use a path like structure to specify the sourcepath for
the Javadoc task.
I was doing this so I could exclude some classes using the exclude property
of a fileset.
But the Javadoc task says that it can;'t find any casses to build, even
though fileset
includes all files in dir by default. But if I uncomment the pathelement
line (ie
outside the fileset) then it finds the files ok.

What do I need to do to my fileset to make it find the files referenced in
the pathelement property?

<javadoc
  <!-- snipped -->
  <sourcepath >
    <!-- pathelement location="${build.src}" /-->
    <fileset dir="${build.src}" >
      <!-- include name="**/**" / -->
      <!-- exclude name="**/test/**" / -->
    </fileset>
  </sourcepath>
</javadoc>


William Ferguson


Re: Filesets

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "WF" == William Ferguson <wi...@verveinc.com> writes:

 WF> OK, I guess I'm doing something really dumb, so I guess you guys
 WF> will spot it quickly ..

Not dumb at all, just something that is not possible to do,
unfortunately.

 WF> I am attempting to use a path like structure to specify the
 WF> sourcepath for the Javadoc task.  I was doing this so I could
 WF> exclude some classes using the exclude property of a fileset.

Whatever you specify as <sourcepath> elements, will be passed to
javadoc's (the command) -sourcepath (JDK 1.2+) or -classpath (JDK 1.1).

Furthermore Ant will use it to create the list of packages packages
you want your javadocs for (when you've used the .* abbreviation for
package names).

So we have two problems here:

(1) Ant will always create a list of packages, not a list of classes
you want javadocs for. This means you cannot exclude single classes,
only complete packages. No workaround at all, sorry.

(2) What 

 WF> <sourcepath > 
 WF>   <fileset dir="${build.src}" > 
 WF>     <include name="**/**" />
 WF>   </fileset>
 WF> </sourcepath>

actually does for javadoc (the command) is adding every single file
below ${build.src} to the classpath (or sourcepath). 

Just like the JVM itself, javadoc doesn't know what to do with this. A
CLASSPATH holds directories or archives. Therefore you still need to
point javadoc to ${build.src} directly.

Stefan