This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Excluding files from scaladoc (NetBeans related?)

4 replies
Peter C. Chapin 2
Joined: 2011-01-07,
User offline. Last seen 42 years 45 weeks ago.

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

david.bernard
Joined: 2009-01-08,
User offline. Last seen 1 year 27 weeks ago.
Re: Excluding files from scaladoc (NetBeans related?)
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 <PChapin [at] vtc [dot] vsc [dot] edu> 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


Peter C. Chapin 2
Joined: 2011-01-07,
User offline. Last seen 42 years 45 weeks ago.
Re: Excluding files from scaladoc (NetBeans related?)

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:

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

Pedro Furlanetto
Joined: 2009-08-19,
User offline. Last seen 2 years 34 weeks ago.
Re: Excluding files from scaladoc (NetBeans related?)

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

.....

On Fri, Mar 25, 2011 at 10:52 AM, Peter C. Chapin 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:
>
>         destdir="${dist.javadoc.dir}" doctitle="${javadoc.windowtitle}"
> encoding="${javadoc.encoding.used}" srcdir="${src.dir}" unchecked="yes">
>            
>                
>                
>                    
>                
>            
>        
>
> 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
>

Peter C. Chapin 2
Joined: 2011-01-07,
User offline. Last seen 42 years 45 weeks ago.
Re: Excluding files from scaladoc (NetBeans related?)

On Fri, 25 Mar 2011, Pedro Furlanetto wrote:

> From the build.xml in the Scala sources, notice the 'exclude' tags:
>
> 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="http://www.scala-lang.org/pack.classpath#">
>
>
>
>
>
>
>
>
>
> .....
>
>

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

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland