Skip to content

Commit

Permalink
Add processScripts and includeMainForScripts GroovyDoc config params (c…
Browse files Browse the repository at this point in the history
…loses #148)
  • Loading branch information
keeganwitt committed Jan 28, 2020
1 parent a1c06d0 commit 2485ef3
Showing 1 changed file with 28 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,22 @@ public abstract class AbstractGroovyDocMojo extends AbstractGroovySourcesMojo {
@Parameter(defaultValue = "PROJECT_ONLY")
protected IncludeClasspath includeClasspath;

/**
* Whether to process Groovy Scripts.
*
* @since 1.8.2
*/
@Parameter(defaultValue = "true")
protected boolean processScripts;

/**
* Whether to include the implicit <code>public static void main</code> method for scripts.
*
* @since 1.8.2
*/
@Parameter(defaultValue = "true")
protected boolean includeMainForScripts;

/**
* Generates the GroovyDoc for the specified sources.
*
Expand Down Expand Up @@ -236,22 +252,24 @@ protected synchronized void doGroovyDocGeneration(final FileSet[] sourceDirector
*/
protected Properties setupProperties() {
Properties properties = new Properties();
properties.setProperty("windowTitle", windowTitle);
properties.setProperty("docTitle", docTitle);
properties.setProperty("footer", footer);
properties.setProperty("header", header);
properties.setProperty("author", Boolean.toString(displayAuthor));
properties.setProperty("overviewFile", overviewFile != null ? overviewFile.getAbsolutePath() : "");
properties.put("windowTitle", windowTitle);
properties.put("docTitle", docTitle);
properties.put("footer", footer);
properties.put("header", header);
properties.put("author", Boolean.toString(displayAuthor));
properties.put("overviewFile", overviewFile != null ? overviewFile.getAbsolutePath() : "");
properties.put("processScripts", Boolean.toString(processScripts));
properties.put("includeMainForScripts", Boolean.toString(includeMainForScripts));
try {
Scopes scopeVal = Scopes.valueOf(scope.toUpperCase());
if (scopeVal.equals(Scopes.PUBLIC)) {
properties.setProperty("publicScope", "true");
properties.put("publicScope", "true");
} else if (scopeVal.equals(Scopes.PROTECTED)) {
properties.setProperty("protectedScope", "true");
properties.put("protectedScope", "true");
} else if (scopeVal.equals(Scopes.PACKAGE)) {
properties.setProperty("packageScope", "true");
properties.put("packageScope", "true");
} else if (scopeVal.equals(Scopes.PRIVATE)) {
properties.setProperty("privateScope", "true");
properties.put("privateScope", "true");
}
} catch (IllegalArgumentException e) {
getLog().warn("Scope (" + scope + ") was not recognized. Skipping argument.");
Expand Down

0 comments on commit 2485ef3

Please sign in to comment.