Package org.codehaus.gmavenplus.mojo
Class AbstractGroovyDocMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.codehaus.gmavenplus.mojo.AbstractGroovyMojo
-
- org.codehaus.gmavenplus.mojo.AbstractGroovySourcesMojo
-
- org.codehaus.gmavenplus.mojo.AbstractGroovyDocMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
GroovyDocMojo,GroovyDocTestsMojo
public abstract class AbstractGroovyDocMojo extends AbstractGroovySourcesMojo
The base GroovyDoc mojo, which all GroovyDoc mojos extend.- Since:
- 1.0-beta-1
- Author:
- Keegan Witt
-
-
Field Summary
Fields Modifier and Type Field Description protected booleandisplayAuthorWhether to display the author in the generated GroovyDoc.protected StringdocTitleThe page title.protected StringfooterThe page footer.protected static VersionGROOVY_1_5_2Groovy 1.5.2 version.protected static VersionGROOVY_1_5_8Groovy 1.5.8 version.protected static VersionGROOVY_1_6_0_RC1Groovy 1.6.0 RC-1 version.protected static VersionGROOVY_1_6_0_RC2Groovy 1.6.0 RC-2 version.protected booleangroovyDocJavaSourcesWhether to include Java sources in GroovyDoc generation.protected FilegroovyDocOutputDirectoryThe location for the generated API docs.protected StringheaderThe page header.protected List<Link>linksLinks to include in the generated GroovyDoc (key is link href, value is comma-separated packages to use that link).protected FileoverviewFileThe HTML file to be used for overview documentation.protected StringscopeThe scope to generate GroovyDoc for.protected booleanskipGroovyDocFlag to allow GroovyDoc generation to be skipped.protected StringstylesheetEncodingThe encoding of stylesheetFile.protected FilestylesheetFileThe stylesheet file (absolute path) to copy to output directory (will overwrite default stylesheet.css).protected FiletestGroovyDocOutputDirectoryThe location for the generated test API docs.protected StringwindowTitleThe window title.-
Fields inherited from class org.codehaus.gmavenplus.mojo.AbstractGroovySourcesMojo
MAIN, sources, TEST, testSources
-
Fields inherited from class org.codehaus.gmavenplus.mojo.AbstractGroovyMojo
classWrangler, GROOVY_1_5_0, GROOVY_SOURCES_PATTERN, JAVA_1_7, JAVA_1_8, JAVA_SOURCES_PATTERN, minGroovyVersion, mojoExecution, pluginArtifacts, project, session, skipTests
-
-
Constructor Summary
Constructors Constructor Description AbstractGroovyDocMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcopyStylesheet(File outputDirectory)Copies the stylesheet to the specified output directory.protected ObjectcreateGroovyDocTool(Class<?> groovyDocToolClass, Class<?> resourceManagerClass, Properties docProperties, Object classpathResourceManager, List<String> sourceDirectories, GroovyDocTemplateInfo groovyDocTemplateInfo, List groovyDocLinks)Instantiates a new GroovyDocTool.protected voiddoGroovyDocGeneration(org.apache.maven.shared.model.fileset.FileSet[] sourceDirectories, List classpath, File outputDirectory)Generates the GroovyDoc for the specified sources.protected voidgenerateGroovyDoc(File outputDirectory, Class<?> groovyDocToolClass, Class<?> outputToolClass, Object fileOutputTool, List<String> groovyDocSources, Object groovyDocTool)Performs the GroovyDoc generation.protected List<String>setupGroovyDocSources(org.apache.maven.shared.model.fileset.FileSet[] sourceDirectories, org.apache.maven.shared.model.fileset.util.FileSetManager fileSetManager)Gets the Groovy sources without the Java sources (since the Java sources don't have Javadoc).protected ListsetupLinks()Sets up the GroovyDoc links.protected PropertiessetupProperties()Sets up the documentation properties.-
Methods inherited from class org.codehaus.gmavenplus.mojo.AbstractGroovySourcesMojo
getFiles, getFilesets, getSourceRoots, getSourceRoots, getSources, getSources, getTestSourceRoots, getTestSourceRoots, getTestSources, getTestSources, setSources, setTestSources
-
Methods inherited from class org.codehaus.gmavenplus.mojo.AbstractGroovyMojo
getJavaVersion, getJavaVersionString, groovyAtLeast, groovyIs, groovyNewerThan, groovyOlderThan, groovyVersionSupportsAction, isJavaSupportIndy, isJavaSupportParameters, logPluginClasspath
-
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
-
-
-
Field Detail
-
GROOVY_1_6_0_RC2
protected static final Version GROOVY_1_6_0_RC2
Groovy 1.6.0 RC-2 version.
-
GROOVY_1_6_0_RC1
protected static final Version GROOVY_1_6_0_RC1
Groovy 1.6.0 RC-1 version.
-
GROOVY_1_5_8
protected static final Version GROOVY_1_5_8
Groovy 1.5.8 version.
-
GROOVY_1_5_2
protected static final Version GROOVY_1_5_2
Groovy 1.5.2 version.
-
groovyDocOutputDirectory
@Parameter(defaultValue="${project.build.directory}/gapidocs") protected File groovyDocOutputDirectoryThe location for the generated API docs.
-
testGroovyDocOutputDirectory
@Parameter(defaultValue="${project.build.directory}/testgapidocs") protected File testGroovyDocOutputDirectoryThe location for the generated test API docs.
-
windowTitle
@Parameter(defaultValue="Groovy Documentation") protected String windowTitle
The window title.
-
docTitle
@Parameter(defaultValue="Groovy Documentation") protected String docTitle
The page title.
-
footer
@Parameter(defaultValue="Groovy Documentation") protected String footer
The page footer.
-
header
@Parameter(defaultValue="Groovy Documentation") protected String header
The page header.
-
displayAuthor
@Parameter(defaultValue="true") protected boolean displayAuthor
Whether to display the author in the generated GroovyDoc.
-
overviewFile
@Parameter protected File overviewFile
The HTML file to be used for overview documentation.
-
stylesheetFile
@Parameter protected File stylesheetFile
The stylesheet file (absolute path) to copy to output directory (will overwrite default stylesheet.css).
-
stylesheetEncoding
@Parameter(defaultValue="${project.build.sourceEncoding}") protected String stylesheetEncodingThe encoding of stylesheetFile.
-
scope
@Parameter(defaultValue="private") protected String scope
The scope to generate GroovyDoc for. Should be one of:- "public"
- "protected"
- "package"
- "private"
-
links
@Parameter protected List<Link> links
Links to include in the generated GroovyDoc (key is link href, value is comma-separated packages to use that link).- Since:
- 1.0-beta-2
-
groovyDocJavaSources
@Parameter(defaultValue="true") protected boolean groovyDocJavaSources
Whether to include Java sources in GroovyDoc generation.- Since:
- 1.0-beta-2
-
skipGroovyDoc
@Parameter(property="maven.groovydoc.skip", defaultValue="false") protected boolean skipGroovyDocFlag to allow GroovyDoc generation to be skipped.- Since:
- 1.6
-
-
Method Detail
-
doGroovyDocGeneration
protected void doGroovyDocGeneration(org.apache.maven.shared.model.fileset.FileSet[] sourceDirectories, List classpath, File outputDirectory) throws ClassNotFoundException, InvocationTargetException, IllegalAccessException, InstantiationException, MalformedURLExceptionGenerates the GroovyDoc for the specified sources.- Parameters:
sourceDirectories- The source directories to generate GroovyDoc forclasspath- The classpath to use for compilationoutputDirectory- The directory to save the generated GroovyDoc in- Throws:
ClassNotFoundException- when a class needed for GroovyDoc generation cannot be foundInstantiationException- when a class needed for GroovyDoc generation cannot be instantiatedIllegalAccessException- when a method needed for GroovyDoc generation cannot be accessedInvocationTargetException- when a reflection invocation needed for GroovyDoc generation cannot be completedMalformedURLException- when a classpath element provides a malformed URL
-
setupProperties
protected Properties setupProperties()
Sets up the documentation properties.- Returns:
- the documentation properties
-
setupLinks
protected List setupLinks() throws ClassNotFoundException, InvocationTargetException, IllegalAccessException, InstantiationException
Sets up the GroovyDoc links.- Returns:
- the GroovyDoc links
- Throws:
ClassNotFoundException- when a class needed for setting up GroovyDoc links cannot be foundInstantiationException- when a class needed for setting up GroovyDoc links cannot be instantiatedIllegalAccessException- when a method needed for setting up GroovyDoc links cannot be accessedInvocationTargetException- when a reflection invocation needed for setting up GroovyDoc links cannot be completed
-
createGroovyDocTool
protected Object createGroovyDocTool(Class<?> groovyDocToolClass, Class<?> resourceManagerClass, Properties docProperties, Object classpathResourceManager, List<String> sourceDirectories, GroovyDocTemplateInfo groovyDocTemplateInfo, List groovyDocLinks) throws InvocationTargetException, IllegalAccessException, InstantiationException
Instantiates a new GroovyDocTool.- Parameters:
groovyDocToolClass- the GroovyDocTool classresourceManagerClass- the ResourceManager lassdocProperties- the documentation propertiesclasspathResourceManager- the ClasspathResourceManager for the GroovyDocToolsourceDirectories- the source directories for the GroovyDocToolgroovyDocTemplateInfo- the GroovyDocTemplateInfo for the GroovyDocToolgroovyDocLinks- the GroovyDoc links- Returns:
- the GroovyDocTool to use in GroovyDoc generation
- Throws:
InstantiationException- when a class needed for setting up GroovyDoc tool cannot be instantiatedIllegalAccessException- when a method needed for setting up GroovyDoc tool cannot be accessedInvocationTargetException- when a reflection invocation needed for setting up GroovyDoc tool cannot be completed
-
setupGroovyDocSources
protected List<String> setupGroovyDocSources(org.apache.maven.shared.model.fileset.FileSet[] sourceDirectories, org.apache.maven.shared.model.fileset.util.FileSetManager fileSetManager)
Gets the Groovy sources without the Java sources (since the Java sources don't have Javadoc).- Parameters:
sourceDirectories- the source directories to get the Groovy sources fromfileSetManager- the FileSetmanager to use to get the included files- Returns:
- the groovy sources
-
generateGroovyDoc
protected void generateGroovyDoc(File outputDirectory, Class<?> groovyDocToolClass, Class<?> outputToolClass, Object fileOutputTool, List<String> groovyDocSources, Object groovyDocTool) throws InvocationTargetException, IllegalAccessException
Performs the GroovyDoc generation.- Parameters:
outputDirectory- the directory to output the GroovyDoc togroovyDocToolClass- the GroovyDocTool classoutputToolClass- the OutputTool classfileOutputTool- the FileOutputTool to use for GroovyDoc generationgroovyDocSources- the sources togroovyDocTool- the GroovyDocTool to use for GroovyDoc generation- Throws:
IllegalAccessException- when a method needed for GroovyDoc generation cannot be accessedInvocationTargetException- when a reflection invocation needed for GroovyDoc generation cannot be completed
-
copyStylesheet
protected void copyStylesheet(File outputDirectory)
Copies the stylesheet to the specified output directory.- Parameters:
outputDirectory- The output directory to copy the stylesheet to
-
-