tags:

views:

68

answers:

1

I wish to compile scaladoc and javadoc in a project with both scala and java in it. The project has more than one source directory (each of which may have scala or javadoc). I tried:

  <scaladoc destdir="doc">
    <classpath refid="compile.classpath"/>

    <src>
      <fileset dir="src"/>
      <fileset dir="tweetstream4j/src"/>
    </src>

    <include name="src/**/*.scala"/>
  </scaladoc>

and several variants thereof. For the above variant I get:

BUILD FAILED
/blah/build.xml:119: /blah/src/com/foo/Blah.java is not a directory.

where "Blah.java" is a file in my source tree.

I've looked at the scaladoc ant task doc and the scaladoc man page. I'm using scala2.7.7final (because that's what apt-get puts on my Ubuntu system).

Suggestions of how to get scaladoc and javadoc out of "src" and "tweetstream4j/src"?

+1  A: 

I had the same question and came across this. Those <src> elements don't seem well documented but I was able to put together something that works from various examples I found on the web:

<scaladoc destdir="doc">
    <classpath refid="compile.classpath"/>
    <src path="src"/>
    <src path="tweetstream4j/src"/>
    <include name="**/*.java"/>
    <include name="**/*.scala"/>
</scaladoc>

That will look in both source directories for all Java and Scala code and build one set of documentation for it all.

Harold L