You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Simon Harrer <si...@gmail.com> on 2010/11/11 20:04:44 UTC

Building JavaDoc for Groovy Project

Hi buildr Community.

I think buildr is really cool. But currently, I am stuck generating javadoc

project structure:
src/main/java <-- java and groovy sources
target/classes <-- output folder

This works perfectly with the groovyc joint compiler.

However, when using the doc command, buildr states that it cannot guess the
language and aborts. And I do not find a way to specify that I want javadoc
generated for src/main/java.

My only other solution would be to create such a javadoc task myself by
leveraging ant or the command line. Or is there a solution with buildr?

Best regards,
Simon

Re: Building JavaDoc for Groovy Project

Posted by Alex Boisvert <al...@gmail.com>.
On Mon, Nov 15, 2010 at 12:58 PM, Simon Harrer <si...@gmail.com>wrote:

> I found that groovydoc should do the job. And in the buildr documentation,
> it states, that groovydoc can be used. However, I could not get it to work.
> I searched in the sources and found no Doc Classes in the groovy folders.
>
> See http://buildr.apache.org/languages.html#groovy for reference to the
> groovydoc task
>
> My idea is to be able to use groovydoc only and produce a groovydoc for all
> of my projects which is combined like the javadoc is.
>

Interesting...  this appears to be forward-looking documentation since
Groovydoc has never been implemented :-|

Anyhow, I just implemented it and will be committing it shortly.  It
required a small change to the doc framework to support multiple file
extensions so I want to write a few additional tests beforehand.

I created an issue to track this:
https://issues.apache.org/jira/browse/BUILDR-550

alex

Re: Building JavaDoc for Groovy Project

Posted by Alex Boisvert <al...@gmail.com>.
I posted a snapshot from today's trunk here:
http://people.apache.org/~boisvert/buildr/snapshot/gems/

On Wed, Nov 17, 2010 at 2:13 PM, Alex Boisvert <al...@gmail.com>wrote:

> The 1.4.4 RC doesn't have the groovydoc enhancement.  I'll post a separate
> gem for it.
>
> alex
>
>
> On Wed, Nov 17, 2010 at 2:08 PM, Antoine Toulme <an...@lunar-ocean.com>wrote:
>
>> You can either try Buildr 1.4.4 RC or check out the sources, then run:
>> gem build buildr.gemspec
>> buildr install buildr-1.x.x.gem
>>
>> Thanks,
>>
>> Antoine
>>
>> On Nov 17, 2010, at 7:48 AM, Simon Harrer wrote:
>>
>> > Hi again.
>> >
>> > is there a nightly build available including the bugfix? I would like to
>> try
>> > the new buildr gem. I tried to install it from the sources but this did
>> not
>> > work yesterday.
>> >
>> > Then, I can give you feedback about the implementation.
>> >
>> > Cheers,
>> > Simon
>> >
>> > On 15 November 2010 21:58, Simon Harrer <si...@gmail.com> wrote:
>> >
>> >> Hi,
>> >>
>> >> thanks for the comments.
>> >>
>> >> I found that groovydoc should do the job. And in the buildr
>> documentation,
>> >> it states, that groovydoc can be used. However, I could not get it to
>> work.
>> >> I searched in the sources and found no Doc Classes in the groovy
>> folders.
>> >>
>> >> See http://buildr.apache.org/languages.html#groovy for reference to
>> the
>> >> groovydoc task
>> >>
>> >> My idea is to be able to use groovydoc only and produce a groovydoc for
>> all
>> >> of my projects which is combined like the javadoc is.
>> >>
>> >> Cheers,
>> >> Simon
>> >>
>> >> On 11 November 2010 20:04, Simon Harrer <si...@gmail.com>
>> wrote:
>> >>
>> >>> Hi buildr Community.
>> >>>
>> >>> I think buildr is really cool. But currently, I am stuck generating
>> >>> javadoc
>> >>>
>> >>> project structure:
>> >>> src/main/java <-- java and groovy sources
>> >>> target/classes <-- output folder
>> >>>
>> >>> This works perfectly with the groovyc joint compiler.
>> >>>
>> >>> However, when using the doc command, buildr states that it cannot
>> guess
>> >>> the language and aborts. And I do not find a way to specify that I
>> want
>> >>> javadoc generated for src/main/java.
>> >>>
>> >>> My only other solution would be to create such a javadoc task myself
>> by
>> >>> leveraging ant or the command line. Or is there a solution with
>> buildr?
>> >>>
>> >>> Best regards,
>> >>> Simon
>> >>>
>> >>
>> >>
>>
>>
>

Re: Building JavaDoc for Groovy Project

Posted by Alex Boisvert <al...@gmail.com>.
The 1.4.4 RC doesn't have the groovydoc enhancement.  I'll post a separate
gem for it.

alex

On Wed, Nov 17, 2010 at 2:08 PM, Antoine Toulme <an...@lunar-ocean.com>wrote:

> You can either try Buildr 1.4.4 RC or check out the sources, then run:
> gem build buildr.gemspec
> buildr install buildr-1.x.x.gem
>
> Thanks,
>
> Antoine
>
> On Nov 17, 2010, at 7:48 AM, Simon Harrer wrote:
>
> > Hi again.
> >
> > is there a nightly build available including the bugfix? I would like to
> try
> > the new buildr gem. I tried to install it from the sources but this did
> not
> > work yesterday.
> >
> > Then, I can give you feedback about the implementation.
> >
> > Cheers,
> > Simon
> >
> > On 15 November 2010 21:58, Simon Harrer <si...@gmail.com> wrote:
> >
> >> Hi,
> >>
> >> thanks for the comments.
> >>
> >> I found that groovydoc should do the job. And in the buildr
> documentation,
> >> it states, that groovydoc can be used. However, I could not get it to
> work.
> >> I searched in the sources and found no Doc Classes in the groovy
> folders.
> >>
> >> See http://buildr.apache.org/languages.html#groovy for reference to the
> >> groovydoc task
> >>
> >> My idea is to be able to use groovydoc only and produce a groovydoc for
> all
> >> of my projects which is combined like the javadoc is.
> >>
> >> Cheers,
> >> Simon
> >>
> >> On 11 November 2010 20:04, Simon Harrer <si...@gmail.com> wrote:
> >>
> >>> Hi buildr Community.
> >>>
> >>> I think buildr is really cool. But currently, I am stuck generating
> >>> javadoc
> >>>
> >>> project structure:
> >>> src/main/java <-- java and groovy sources
> >>> target/classes <-- output folder
> >>>
> >>> This works perfectly with the groovyc joint compiler.
> >>>
> >>> However, when using the doc command, buildr states that it cannot guess
> >>> the language and aborts. And I do not find a way to specify that I want
> >>> javadoc generated for src/main/java.
> >>>
> >>> My only other solution would be to create such a javadoc task myself by
> >>> leveraging ant or the command line. Or is there a solution with buildr?
> >>>
> >>> Best regards,
> >>> Simon
> >>>
> >>
> >>
>
>

Re: Building JavaDoc for Groovy Project

Posted by Antoine Toulme <an...@lunar-ocean.com>.
You can either try Buildr 1.4.4 RC or check out the sources, then run:
gem build buildr.gemspec
buildr install buildr-1.x.x.gem

Thanks,

Antoine

On Nov 17, 2010, at 7:48 AM, Simon Harrer wrote:

> Hi again.
> 
> is there a nightly build available including the bugfix? I would like to try
> the new buildr gem. I tried to install it from the sources but this did not
> work yesterday.
> 
> Then, I can give you feedback about the implementation.
> 
> Cheers,
> Simon
> 
> On 15 November 2010 21:58, Simon Harrer <si...@gmail.com> wrote:
> 
>> Hi,
>> 
>> thanks for the comments.
>> 
>> I found that groovydoc should do the job. And in the buildr documentation,
>> it states, that groovydoc can be used. However, I could not get it to work.
>> I searched in the sources and found no Doc Classes in the groovy folders.
>> 
>> See http://buildr.apache.org/languages.html#groovy for reference to the
>> groovydoc task
>> 
>> My idea is to be able to use groovydoc only and produce a groovydoc for all
>> of my projects which is combined like the javadoc is.
>> 
>> Cheers,
>> Simon
>> 
>> On 11 November 2010 20:04, Simon Harrer <si...@gmail.com> wrote:
>> 
>>> Hi buildr Community.
>>> 
>>> I think buildr is really cool. But currently, I am stuck generating
>>> javadoc
>>> 
>>> project structure:
>>> src/main/java <-- java and groovy sources
>>> target/classes <-- output folder
>>> 
>>> This works perfectly with the groovyc joint compiler.
>>> 
>>> However, when using the doc command, buildr states that it cannot guess
>>> the language and aborts. And I do not find a way to specify that I want
>>> javadoc generated for src/main/java.
>>> 
>>> My only other solution would be to create such a javadoc task myself by
>>> leveraging ant or the command line. Or is there a solution with buildr?
>>> 
>>> Best regards,
>>> Simon
>>> 
>> 
>> 


Re: Building JavaDoc for Groovy Project

Posted by Alex Boisvert <al...@gmail.com>.
On Thu, Nov 18, 2010 at 9:03 AM, Simon Harrer <si...@gmail.com>wrote:

> thanks for the Gem. I tried it. However there seems to go something wrong.
>
> All my html files for the classes are stored in the DefaultPackage while
> the
> package html files are correctly created.
>
> After  a little investigation it seems that GroovyDoc only want to have a
> list of source directories instead of a list of source files. Is it
> possible
> to rewrite the doc task for working with source directories instead of the
> comple paths to the source files?
>

Cool, I'll fix that.


> Using the ant script below, everything is created fine.
>
> <project
> name="test" default="doc"
> >
> <target
> name="doc"
> >
>  <taskdef
> name="groovydoc"
> classname="org.codehaus.groovy.ant.Groovydoc"
>
>  classpath="C:/dev/eclipse/plugins/org.codehaus.groovy_1.7.5.xx-20101007-1100-e36-RC2/lib/groovy-all-1.7.5.jar"
> />
> <groovydoc
>  destdir="doc/gapi"
> sourcepath="src/main/java"
> packagenames="**.*"
>  use="true"
> windowtitle="WINDOW_TITLE"
> doctitle="DOC_TITLE"
>  header="HEADER"
> footer="FOOTER"
> private="false"
>  >
> </groovydoc>
> </target>
>
> </project>
>
> Maybe buildr could leverage this ant task for the GroovyDoc creation?
>

We could but it wouldn't save us much, since the Ant task is just a thin
wrapper around the GroovyDoc main class and right now we're calling the main
class directly.   Argument processing ends up being more straightforward.

alex

Re: Building JavaDoc for Groovy Project

Posted by Simon Harrer <si...@gmail.com>.
Hi Alex,

thanks for the Gem. I tried it. However there seems to go something wrong.

All my html files for the classes are stored in the DefaultPackage while the
package html files are correctly created.

After  a little investigation it seems that GroovyDoc only want to have a
list of source directories instead of a list of source files. Is it possible
to rewrite the doc task for working with source directories instead of the
comple paths to the source files?

Using the ant script below, everything is created fine.

<project
name="test" default="doc"
>
<target
name="doc"
>
 <taskdef
name="groovydoc"
classname="org.codehaus.groovy.ant.Groovydoc"
 classpath="C:/dev/eclipse/plugins/org.codehaus.groovy_1.7.5.xx-20101007-1100-e36-RC2/lib/groovy-all-1.7.5.jar"
/>
<groovydoc
 destdir="doc/gapi"
sourcepath="src/main/java"
packagenames="**.*"
 use="true"
windowtitle="WINDOW_TITLE"
doctitle="DOC_TITLE"
 header="HEADER"
footer="FOOTER"
private="false"
 >
</groovydoc>
</target>

</project>

Maybe buildr could leverage this ant task for the GroovyDoc creation?

Cheers,
Simon

On 17 November 2010 16:48, Simon Harrer <si...@gmail.com> wrote:

> Hi again.
>
> is there a nightly build available including the bugfix? I would like to
> try the new buildr gem. I tried to install it from the sources but this did
> not work yesterday.
>
> Then, I can give you feedback about the implementation.
>
> Cheers,
> Simon
>
>
> On 15 November 2010 21:58, Simon Harrer <si...@gmail.com> wrote:
>
>> Hi,
>>
>> thanks for the comments.
>>
>> I found that groovydoc should do the job. And in the buildr documentation,
>> it states, that groovydoc can be used. However, I could not get it to work.
>> I searched in the sources and found no Doc Classes in the groovy folders.
>>
>> See http://buildr.apache.org/languages.html#groovy for reference to the
>> groovydoc task
>>
>> My idea is to be able to use groovydoc only and produce a groovydoc for
>> all of my projects which is combined like the javadoc is.
>>
>> Cheers,
>> Simon
>>
>> On 11 November 2010 20:04, Simon Harrer <si...@gmail.com> wrote:
>>
>>> Hi buildr Community.
>>>
>>> I think buildr is really cool. But currently, I am stuck generating
>>> javadoc
>>>
>>> project structure:
>>> src/main/java <-- java and groovy sources
>>> target/classes <-- output folder
>>>
>>> This works perfectly with the groovyc joint compiler.
>>>
>>> However, when using the doc command, buildr states that it cannot guess
>>> the language and aborts. And I do not find a way to specify that I want
>>> javadoc generated for src/main/java.
>>>
>>> My only other solution would be to create such a javadoc task myself by
>>> leveraging ant or the command line. Or is there a solution with buildr?
>>>
>>> Best regards,
>>> Simon
>>>
>>
>>
>

Re: Building JavaDoc for Groovy Project

Posted by Simon Harrer <si...@gmail.com>.
Hi again.

is there a nightly build available including the bugfix? I would like to try
the new buildr gem. I tried to install it from the sources but this did not
work yesterday.

Then, I can give you feedback about the implementation.

Cheers,
Simon

On 15 November 2010 21:58, Simon Harrer <si...@gmail.com> wrote:

> Hi,
>
> thanks for the comments.
>
> I found that groovydoc should do the job. And in the buildr documentation,
> it states, that groovydoc can be used. However, I could not get it to work.
> I searched in the sources and found no Doc Classes in the groovy folders.
>
> See http://buildr.apache.org/languages.html#groovy for reference to the
> groovydoc task
>
> My idea is to be able to use groovydoc only and produce a groovydoc for all
> of my projects which is combined like the javadoc is.
>
> Cheers,
> Simon
>
> On 11 November 2010 20:04, Simon Harrer <si...@gmail.com> wrote:
>
>> Hi buildr Community.
>>
>> I think buildr is really cool. But currently, I am stuck generating
>> javadoc
>>
>> project structure:
>> src/main/java <-- java and groovy sources
>> target/classes <-- output folder
>>
>> This works perfectly with the groovyc joint compiler.
>>
>> However, when using the doc command, buildr states that it cannot guess
>> the language and aborts. And I do not find a way to specify that I want
>> javadoc generated for src/main/java.
>>
>> My only other solution would be to create such a javadoc task myself by
>> leveraging ant or the command line. Or is there a solution with buildr?
>>
>> Best regards,
>> Simon
>>
>
>

Re: Building JavaDoc for Groovy Project

Posted by Simon Harrer <si...@gmail.com>.
Hi,

thanks for the comments.

I found that groovydoc should do the job. And in the buildr documentation,
it states, that groovydoc can be used. However, I could not get it to work.
I searched in the sources and found no Doc Classes in the groovy folders.

See http://buildr.apache.org/languages.html#groovy for reference to the
groovydoc task

My idea is to be able to use groovydoc only and produce a groovydoc for all
of my projects which is combined like the javadoc is.

Cheers,
Simon

On 11 November 2010 20:04, Simon Harrer <si...@gmail.com> wrote:

> Hi buildr Community.
>
> I think buildr is really cool. But currently, I am stuck generating javadoc
>
> project structure:
> src/main/java <-- java and groovy sources
> target/classes <-- output folder
>
> This works perfectly with the groovyc joint compiler.
>
> However, when using the doc command, buildr states that it cannot guess the
> language and aborts. And I do not find a way to specify that I want javadoc
> generated for src/main/java.
>
> My only other solution would be to create such a javadoc task myself by
> leveraging ant or the command line. Or is there a solution with buildr?
>
> Best regards,
> Simon
>

Re: Building JavaDoc for Groovy Project

Posted by Ed Smiley <es...@ebrary.com>.
I think this might work if you put the groovy files in src/main/groovy and
put the Java files in src/main/java.
The joint compiler is supposed to look in both places.  However the javadoc
task may need to see only Java in src/main/java.
Give it a shot.

In the documentation....
"Once loaded, the groovyc compiler will be automatically selected if any
.groovy source files are found under src/main/groovy directory, compiling
them by default into the target/classes directory.... If the project has
java sources in src/main/java they will get compiled using the groovyc joint
compiler."


On Thu, Nov 11, 2010 at 11:04 AM, Simon Harrer <si...@gmail.com>wrote:

> Hi buildr Community.
>
> I think buildr is really cool. But currently, I am stuck generating javadoc
>
> project structure:
> src/main/java <-- java and groovy sources
> target/classes <-- output folder
>
> This works perfectly with the groovyc joint compiler.
>
> However, when using the doc command, buildr states that it cannot guess the
> language and aborts. And I do not find a way to specify that I want javadoc
> generated for src/main/java.
>
> My only other solution would be to create such a javadoc task myself by
> leveraging ant or the command line. Or is there a solution with buildr?
>
> Best regards,
> Simon
>

Re: Building JavaDoc for Groovy Project

Posted by Alex Boisvert <al...@gmail.com>.
If you want javadoc only for your .java files, simply add the following to
your buildfile:

  doc.using :javadoc

I'm not aware of tools that do combined java + groovy documentation but if
such a thing exists, we could add support for it eventually.

Also, feel free to file an issue for your case.   I think javadoc should be
the default for joint java + groovy projects for the time being.

alex

On Thu, Nov 11, 2010 at 11:04 AM, Simon Harrer <si...@gmail.com>wrote:

> Hi buildr Community.
>
> I think buildr is really cool. But currently, I am stuck generating javadoc
>
> project structure:
> src/main/java <-- java and groovy sources
> target/classes <-- output folder
>
> This works perfectly with the groovyc joint compiler.
>
> However, when using the doc command, buildr states that it cannot guess the
> language and aborts. And I do not find a way to specify that I want javadoc
> generated for src/main/java.
>
> My only other solution would be to create such a javadoc task myself by
> leveraging ant or the command line. Or is there a solution with buildr?
>
> Best regards,
> Simon
>