Steve
Steve

Reputation: 4701

Groovydoc produces blank documents

I'm writing a class in Groovy, and I want to generate Groovydoc for it (from the command line). In my class, I've written documentation for the methods like this:

/**
 * Returns blah blah blah
*/
def getFoo(){
    ...
}

But when I run groovydoc -classpath C:\groovyStuff\ -d . *.groovy

It generates the HTML template, but no actual content.

What have I done wrong?

Upvotes: 2

Views: 2344

Answers (3)

Илья А.
Илья А.

Reputation: 11

If you application consists of Java & Groovy files you can leverage next bash script which lists all java & groovy files in the source directory (even skipping undesired ones)

source_files=`find {path-to-your-dir}/ -type f \( \
    \( \
    -name "*.java" \
    -or -name "*.groovy" \
    \) \
    ! \
    \( \
     -name "UndesiredOne.java" \
     -or -name "UndesiredTwo.groovy" \
    \) \
    \)`

groovydoc -verbose --debug -public\
 -d {path-to-your-doc-dir}\
 -doctitle "Title"\
 -header "Header"\
 -footer "Footer"\
 -windowtitle "WindowTitle"\
 $source_files

Upvotes: 0

Etienne Tonnelier
Etienne Tonnelier

Reputation: 2239

For Eclipse users, here is a workaround:

  1. Go to Project -> Generate Javadoc...
  2. In Javadoc command, replace the 'javadoc.exe' path with the 'groovydoc.bat' path.
  3. Select the sources to be generated, the visibility and use the standard doclet (I suggest you create a new file src/main/groovydoc and delete src/main/javadoc)

enter image description here

Upvotes: 1

Jeff Scott Brown
Jeff Scott Brown

Reputation: 27245

If the root of your source tree is c:\groovyStuff\ you can use something like this...

groovydoc -sourcepath c:\groovyStuff -d . com.somepackage

The -d . is a little peculiar because that is going to put the generated files in the current directory. That is what you used in your example but maybe you want something like -d output or something similar.

Does that help?

Upvotes: 2

Related Questions