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 26, 2020
1 parent a1c06d0 commit 66765f4
Showing 1 changed file with 24 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,18 @@ public abstract class AbstractGroovyDocMojo extends AbstractGroovySourcesMojo {
@Parameter(defaultValue = "PROJECT_ONLY")
protected IncludeClasspath includeClasspath;

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

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

/**
* Generates the GroovyDoc for the specified sources.
*
Expand Down Expand Up @@ -236,22 +248,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 66765f4

Please sign in to comment.