[scala-tools] Excluding files from scaladoc (NetBeans related?)

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[scala-tools] Excluding files from scaladoc (NetBeans related?)

Peter C. Chapin-3
I'm using NetBeans 6.9.1 with my current project. I'd like to generate
scaladocs for my project. However, my source folders currently contain a
file that is neither Scala nor Java. Specifically it is an ANTLR grammar.
When I run the "Generate Javadoc" menu item NetBeans runs Scaladoc fine but
the Scaladoc tool chokes on the ANTLR grammar.

I appear to need a way to exclude certain files from Scaladoc's analysis,
but I don't see how that works. The Scaladoc documentation I've found
doesn't seem to say anything about this, and I couldn't find anything about
it in the various NetBeans dialog boxes (except for a place where I can add
"additional scaladoc options").

I have another project in 100% Java that also has an ANTLR grammar in its
source folders. In that case, however, Javadoc just ignores the grammar
file. So am I led to conclude that Scaladoc just isn't able to handle this
case?

Peter

Reply | Threaded
Open this post in threaded view
|

Re: [scala-tools] Excluding files from scaladoc (NetBeans related?)

David Bernard-3
I'm not a nebeans user.

When scaladoc is called you tell it which file to parse (set directory is not enough). So I suppose you should find a way to tell netbeans to only provide *.java and *.scala to scaladoc (like did by maven-scala-plugin). I suggest you edit your build.xml (IIRC netbeans use ant by default to build).

/davidB

On Thu, Mar 24, 2011 at 20:18, Peter C. Chapin <[hidden email]> wrote:
I'm using NetBeans 6.9.1 with my current project. I'd like to generate scaladocs for my project. However, my source folders currently contain a file that is neither Scala nor Java. Specifically it is an ANTLR grammar. When I run the "Generate Javadoc" menu item NetBeans runs Scaladoc fine but the Scaladoc tool chokes on the ANTLR grammar.

I appear to need a way to exclude certain files from Scaladoc's analysis, but I don't see how that works. The Scaladoc documentation I've found doesn't seem to say anything about this, and I couldn't find anything about it in the various NetBeans dialog boxes (except for a place where I can add "additional scaladoc options").

I have another project in 100% Java that also has an ANTLR grammar in its source folders. In that case, however, Javadoc just ignores the grammar file. So am I led to conclude that Scaladoc just isn't able to handle this case?

Peter


Reply | Threaded
Open this post in threaded view
|

Re: [scala-tools] Excluding files from scaladoc (NetBeans related?)

Peter C. Chapin-3
On Thu, 24 Mar 2011, David Bernard wrote:

> I'm not a nebeans user.
>
> When scaladoc is called you tell it which file to parse (set directory is
> not enough). So I suppose you should find a way to tell netbeans to only
> provide *.java and *.scala to scaladoc (like did by maven-scala-plugin). I
> suggest you edit your build.xml (IIRC netbeans use ant by default to
> build).

Actually I have looked at that but I'm not knowledgable enough about ant
right now to understand what I'm looking at. I suppose that could change. :)

The relevant task is in the file that says "Do not edit this file" so I
imagine I have to set some properties in the file I can edit. I see this
sort of thing:

         <scaladoc addparams="${javadoc.additionalparam}" deprecation="yes"
destdir="${dist.javadoc.dir}" doctitle="${javadoc.windowtitle}"
encoding="${javadoc.encoding.used}" srcdir="${src.dir}" unchecked="yes">
             <classpath>
                 <path path="${javac.classpath}"/>
                 <fileset dir="${scala.lib}">
                     <include name="**/*.jar"/>
                 </fileset>
             </classpath>
         </scaladoc>

I see a srcdir attribute being set to ${src.dir} but I don't see where the
value of src.dir is set. Hmm. Anyway that doesn't sound like it would
contain wildcard file specifications like *.scala, etc.

I guess I'll have to study the ant documentation.

Peter
Reply | Threaded
Open this post in threaded view
|

Re: [scala-tools] Excluding files from scaladoc (NetBeans related?)

Pedro Furlanetto
From the build.xml in the Scala sources, notice the 'exclude' tags:

<scaladoc
      destdir="${build-docs.dir}/library"
      doctitle="Scala Standard Library"
      docversion="${version.number}"
      docsourceurl="https://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/€{FILE_PATH}.scala#L1"
      sourcepath="${src.dir}"
      classpathref="pack.classpath">
      <src>
        <files includes="${src.dir}/actors"/>
        <files includes="${src.dir}/library/scala"/>
        <files includes="${src.dir}/swing"/>
        <files includes="${src.dir}/continuations/library"/>
      </src>
      <include name="**/*.scala"/>
      <exclude name="reflect/Code.scala"/>
      <exclude name="reflect/Manifest.scala"/>
      .....
      <exclude name="scala/swing/test/**"/>
    </scaladoc>

On Fri, Mar 25, 2011 at 10:52 AM, Peter C. Chapin <[hidden email]> wrote:

> On Thu, 24 Mar 2011, David Bernard wrote:
>
>> I'm not a nebeans user.
>>
>> When scaladoc is called you tell it which file to parse (set directory is
>> not enough). So I suppose you should find a way to tell netbeans to only
>> provide *.java and *.scala to scaladoc (like did by maven-scala-plugin). I
>> suggest you edit your build.xml (IIRC netbeans use ant by default to build).
>
> Actually I have looked at that but I'm not knowledgable enough about ant
> right now to understand what I'm looking at. I suppose that could change. :)
>
> The relevant task is in the file that says "Do not edit this file" so I
> imagine I have to set some properties in the file I can edit. I see this
> sort of thing:
>
>        <scaladoc addparams="${javadoc.additionalparam}" deprecation="yes"
> destdir="${dist.javadoc.dir}" doctitle="${javadoc.windowtitle}"
> encoding="${javadoc.encoding.used}" srcdir="${src.dir}" unchecked="yes">
>            <classpath>
>                <path path="${javac.classpath}"/>
>                <fileset dir="${scala.lib}">
>                    <include name="**/*.jar"/>
>                </fileset>
>            </classpath>
>        </scaladoc>
>
> I see a srcdir attribute being set to ${src.dir} but I don't see where the
> value of src.dir is set. Hmm. Anyway that doesn't sound like it would
> contain wildcard file specifications like *.scala, etc.
>
> I guess I'll have to study the ant documentation.
>
> Peter
>
Reply | Threaded
Open this post in threaded view
|

Re: [scala-tools] Excluding files from scaladoc (NetBeans related?)

Peter C. Chapin-3
On Fri, 25 Mar 2011, Pedro Furlanetto wrote:

> From the build.xml in the Scala sources, notice the 'exclude' tags:
>
> <scaladoc
>      destdir="${build-docs.dir}/library"
>      doctitle="Scala Standard Library"
>      docversion="${version.number}"
>      docsourceurl="https://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/€{FILE_PATH}.scala#L1"
>      sourcepath="${src.dir}"
>      classpathref="pack.classpath">
>      <src>
>        <files includes="${src.dir}/actors"/>
>        <files includes="${src.dir}/library/scala"/>
>        <files includes="${src.dir}/swing"/>
>        <files includes="${src.dir}/continuations/library"/>
>      </src>
>      <include name="**/*.scala"/>
>      <exclude name="reflect/Code.scala"/>
>      <exclude name="reflect/Manifest.scala"/>
>      .....
>      <exclude name="scala/swing/test/**"/>
>    </scaladoc>

Thanks. I'm not clear about how I can make this modification to the
build.xml file NetBeans is using without violating the "Do Not Edit"
warning. That is, the file in which the above appears is one generated by
NetBeans (it seems).

I could create my own ant build file and use a NetBeans "free form"
project... or just abandon NetBeans. In fact I encountered some other issues
with the way NetBeans was handling my project that I couldn't figure out so
I went with the second option (abandon NetBeans). I'm in the process of
putting together my own ant build file so I believe I've worked around my
Scaladoc issue.

Peter