Skip to content

Commit 66765f4

Browse files
committed
Add processScripts and includeMainForScripts GroovyDoc config params (closes #148)
1 parent a1c06d0 commit 66765f4

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

src/main/java/org/codehaus/gmavenplus/mojo/AbstractGroovyDocMojo.java

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,18 @@ public abstract class AbstractGroovyDocMojo extends AbstractGroovySourcesMojo {
154154
@Parameter(defaultValue = "PROJECT_ONLY")
155155
protected IncludeClasspath includeClasspath;
156156

157+
/**
158+
* Whether to process Groovy Scripts.
159+
*/
160+
@Parameter(defaultValue = "true")
161+
protected boolean processScripts;
162+
163+
/**
164+
* Whether to include the implicit <code>public static void main</code> method for scripts.
165+
*/
166+
@Parameter(defaultValue = "true")
167+
protected boolean includeMainForScripts;
168+
157169
/**
158170
* Generates the GroovyDoc for the specified sources.
159171
*
@@ -236,22 +248,24 @@ protected synchronized void doGroovyDocGeneration(final FileSet[] sourceDirector
236248
*/
237249
protected Properties setupProperties() {
238250
Properties properties = new Properties();
239-
properties.setProperty("windowTitle", windowTitle);
240-
properties.setProperty("docTitle", docTitle);
241-
properties.setProperty("footer", footer);
242-
properties.setProperty("header", header);
243-
properties.setProperty("author", Boolean.toString(displayAuthor));
244-
properties.setProperty("overviewFile", overviewFile != null ? overviewFile.getAbsolutePath() : "");
251+
properties.put("windowTitle", windowTitle);
252+
properties.put("docTitle", docTitle);
253+
properties.put("footer", footer);
254+
properties.put("header", header);
255+
properties.put("author", Boolean.toString(displayAuthor));
256+
properties.put("overviewFile", overviewFile != null ? overviewFile.getAbsolutePath() : "");
257+
properties.put("processScripts", Boolean.toString(processScripts));
258+
properties.put("includeMainForScripts", Boolean.toString(includeMainForScripts));
245259
try {
246260
Scopes scopeVal = Scopes.valueOf(scope.toUpperCase());
247261
if (scopeVal.equals(Scopes.PUBLIC)) {
248-
properties.setProperty("publicScope", "true");
262+
properties.put("publicScope", "true");
249263
} else if (scopeVal.equals(Scopes.PROTECTED)) {
250-
properties.setProperty("protectedScope", "true");
264+
properties.put("protectedScope", "true");
251265
} else if (scopeVal.equals(Scopes.PACKAGE)) {
252-
properties.setProperty("packageScope", "true");
266+
properties.put("packageScope", "true");
253267
} else if (scopeVal.equals(Scopes.PRIVATE)) {
254-
properties.setProperty("privateScope", "true");
268+
properties.put("privateScope", "true");
255269
}
256270
} catch (IllegalArgumentException e) {
257271
getLog().warn("Scope (" + scope + ") was not recognized. Skipping argument.");

0 commit comments

Comments
 (0)