<groovydoc>
Description
Generates documentation from Groovy and Java source files.
Required taskdef
Assuming groovy-all-VERSION.jar is in my.classpath you will need to declare this task at some point in the build.xml prior to the groovydoc task being invoked.
| Code Block |
|---|
<taskdef name = "groovydoc"
classname = "org.codehaus.groovy.ant.Groovydoc"
classpathref = "my.classpath"/>
|
<groovydoc> Attributes
Attribute | Description | Required |
|---|---|---|
destdir | Location to store the class files. | Yes |
sourcepath | The sourcepath to use. | No |
packagenames | Comma separated list of package files (with terminating wildcard). | No |
use | Create class and package usage pages. | No |
windowtitle | Browser window title for the documentation (text). | No |
doctitle | Include title for the package index(first) page (html-code). | No |
header | Include header text for each page (html-code). | No |
footer | Include footer text for each page (html-code). | No |
overview | Read overview documentation from HTML file. | No |
private | Show all classes and members (i.e. including private ones) if set to "true". | No |
<groovydoc> Nested Elements
link
Create link to groovydoc/javadoc output at the given URL.
Attribute | Description | Required |
|---|---|---|
packages | Comma separated list of package prefixes | Yes |
href | Base URL of external site | Yes |
Example #1 - <groovydoc> Ant task
| Code Block | ||
|---|---|---|
| ||
<taskdef name = "groovydoc"
classname = "org.codehaus.groovy.ant.Groovydoc"
classpathref = "path_to_groovy_all"/>
<groovydoc destdir = "${docsDirectory}/gapi"
sourcepath = "${mainSourceDirectory}"
packagenames = "**.*"
use = "true"
windowtitle = "${title}"
doctitle = "${title}"
header = "${title}"
footer = "${docFooter}"
overview = "src/main/overview.html"
private = "false">
<link packages="java.,org.xml.,javax.,org.xml." href="http://download.oracle.com/javase/6/docs/api"/>
<link packages="org.apache.tools.ant." href="http://evgeny-goldin.org/javadoc/ant/api"/>
<link packages="org.junit.,junit.framework." href="http://kentbeck.github.com/junit/javadoc/latest"/>
<link packages="groovy.,org.codehaus.groovy." href="http://groovy.codehaus.org/api/"/>
<link packages="org.codehaus.gmaven." href="http://evgeny-goldin.org/javadoc/gmaven"/>
</groovydoc>
|
Example #2 - Executing <groovydoc> from Groovy
| Code Block | ||
|---|---|---|
| ||
def ant = new AntBuilder()
ant.taskdef(name: "groovydoc", classname: "org.codehaus.groovy.ant.Groovydoc")
ant.groovydoc(
destdir : "${docsDirectory}/gapi",
sourcepath : "${mainSourceDirectory}",
packagenames : "**.*",
use : "true",
windowtitle : "${title}",
doctitle : "${title}",
header : "${title}",
footer : "${docFooter}",
overview : ""src/main/overview.html",
private : "false") {
link(packages:"java.,org.xml.,javax.,org.xml.",href:"http://download.oracle.com/javase/6/docs/api")
link(packages:"groovy.,org.codehaus.groovy.", href:"http://groovy.codehaus.org/api")
link(packages:"org.apache.tools.ant.", href:"http://evgeny-goldin.org/javadoc/ant/api")
link(packages:"org.junit.,junit.framework.", href:"http://kentbeck.github.com/junit/javadoc/latest")
link(packages:"org.codehaus.gmaven.", href:"http://evgeny-goldin.org/javadoc/gmaven")
}
|