annotate src/main/groovy/org/ssdt_ohio/gradle/tasks/UserDoc.groovy @ 13:a628135958e7

USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
author Dave Smith <smith@nwoca.org>
date Tue, 10 Dec 2013 22:53:57 +0000
parents
children 9de72de14ab3
rev   line source
13
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
1 package org.ssdt_ohio.gradle.tasks
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
2
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
3 import org.codehaus.groovy.tools.groovydoc.ClasspathResourceManager
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
4 import org.codehaus.groovy.tools.groovydoc.FileOutputTool
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
5 import org.codehaus.groovy.tools.groovydoc.GroovyDocTool
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
6 import org.codehaus.groovy.tools.groovydoc.gstringTemplates.GroovyDocTemplateInfo
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
7 import org.gradle.api.InvalidUserDataException
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
8 import org.gradle.api.file.FileCollection
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
9 import org.gradle.api.file.FileVisitDetails
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
10 import org.gradle.api.internal.ClassPathRegistry
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
11 import org.gradle.api.logging.LogLevel
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
12 import org.gradle.api.tasks.InputFiles
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
13 import org.gradle.api.tasks.OutputDirectory
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
14 import org.gradle.api.tasks.SourceTask
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
15 import org.gradle.api.tasks.TaskAction
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
16
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
17 class UserDoc extends SourceTask {
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
18
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
19 private FileCollection groovyClasspath;
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
20
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
21 private FileCollection classpath;
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
22
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
23 private File destinationDir;
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
24
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
25 ClassPathRegistry classPathRegistry
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
26
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
27 public UserDoc() {
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
28 getLogging().captureStandardOutput(LogLevel.INFO);
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
29 classPathRegistry = getServices().get(ClassPathRegistry.class);
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
30 }
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
31
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
32 @TaskAction
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
33 protected void generate() {
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
34 checkGroovyClasspathNonEmpty(getGroovyClasspath().getFiles());
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
35
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
36 def tmpDir = new File(project.buildDir, "tmp/userdoc")
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
37 logger.debug("userdoc tmpDir: $tmpDir")
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
38 project.delete tmpDir
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
39 logger.debug("userdoc source: ${super.source.collect { it.toString() }}")
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
40 project.copy {
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
41 from super.getSource()
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
42 into tmpDir
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
43 }
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
44
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
45 def args = [:]
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
46 args.sourcepath = tmpDir.toString()
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
47 args.destdir = destinationDir
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
48
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
49 Properties properties = new Properties();
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
50 // properties.setProperty("windowTitle", windowTitle);
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
51 // properties.setProperty("docTitle", docTitle);
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
52 // properties.setProperty("footer", footer);
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
53 // properties.setProperty("header", header);
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
54 // checkScopeProperties(properties);
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
55 // properties.setProperty("publicScope", publicScope.toString());
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
56 // properties.setProperty("protectedScope", protectedScope.toString());
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
57 // properties.setProperty("packageScope", packageScope.toString());
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
58 // properties.setProperty("privateScope", privateScope.toString());
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
59 // properties.setProperty("author", author.toString());
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
60 // properties.setProperty("processScripts", processScripts.toString());
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
61 // properties.setProperty("includeMainForScripts", includeMainForScripts.toString());
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
62 // properties.setProperty("overviewFile", overviewFile != null ? overviewFile.getAbsolutePath() : "");
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
63 // properties.setProperty("charset", charset != null ? charset : "");
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
64 // properties.setProperty("fileEncoding", fileEncoding != null ? fileEncoding : "");
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
65 //
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
66
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
67 def tool = new GroovyDocTool(new ClasspathResourceManager(),
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
68 [tmpDir.getPath()] as String[],
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
69 getDocTemplates(),
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
70 getPackageTemplates(),
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
71 getClassTemplates(), [],
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
72 properties)
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
73
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
74 def addFiles = []
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
75
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
76 super.getSource().visit { FileVisitDetails d ->
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
77 if (d.file.isFile()) {
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
78 addFiles << d.getRelativePath().toString()
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
79 }
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
80 }
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
81
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
82 tool.add(addFiles)
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
83 tool.renderToOutput(new FileOutputTool(), destinationDir.getCanonicalPath())
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
84 }
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
85
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
86 private void checkGroovyClasspathNonEmpty(Collection<File> classpath) {
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
87 if (classpath.isEmpty()) {
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
88 throw new InvalidUserDataException("You must assign a Groovy library to the groovy configuration!");
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
89 }
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
90 }
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
91
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
92 /**
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
93 * Returns the directory to generate the documentation into.
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
94 *
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
95 * @return The directory to generate the documentation into
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
96 */
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
97 @OutputDirectory
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
98 public File getDestinationDir() {
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
99 return destinationDir;
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
100 }
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
101
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
102 /**
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
103 * Sets the directory to generate the documentation into.
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
104 */
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
105 public void setDestinationDir(File destinationDir) {
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
106 this.destinationDir = destinationDir;
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
107 }
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
108
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
109 /**
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
110 * Returns the classpath containing the Groovy library to be used.
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
111 *
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
112 * @return The classpath containing the Groovy library to be used
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
113 */
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
114 @InputFiles
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
115 public FileCollection getGroovyClasspath() {
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
116 return groovyClasspath;
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
117 }
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
118
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
119 /**
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
120 * Sets the classpath containing the Groovy library to be used.
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
121 */
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
122 public void setGroovyClasspath(FileCollection groovyClasspath) {
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
123 this.groovyClasspath = groovyClasspath;
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
124 }
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
125
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
126 /**
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
127 * Returns the classpath used to locate classes referenced by the documented sources.
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
128 *
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
129 * @return The classpath used to locate classes referenced by the documented sources
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
130 */
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
131 @InputFiles
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
132 public FileCollection getClasspath() {
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
133 return classpath;
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
134 }
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
135
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
136 /**
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
137 * Sets the classpath used to locate classes referenced by the documented sources.
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
138 */
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
139 public void setClasspath(FileCollection classpath) {
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
140 this.classpath = classpath;
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
141 }
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
142
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
143 /**
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
144 * Creates and returns an array of package template classpath entries.
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
145 * <p>
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
146 * This method is meant to be overridden by custom GroovyDoc implementations, using custom package templates.
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
147 *
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
148 * @return an array of package templates, whereas each entry is resolved as classpath entry, defaults to
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
149 * {@link GroovyDocTemplateInfo#DEFAULT_PACKAGE_TEMPLATES}.
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
150 */
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
151 protected String[] getPackageTemplates() {
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
152 return GroovyDocTemplateInfo.DEFAULT_PACKAGE_TEMPLATES;
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
153 }
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
154
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
155 /**
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
156 * Creates and returns an array of doc template classpath entries.
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
157 * <p>
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
158 * This method is meant to be overridden by custom GroovyDoc implementations, using custom doc templates.
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
159 *
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
160 * @return an array of doc templates, whereas each entry is resolved as classpath entry, defaults to
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
161 * {@link GroovyDocTemplateInfo#DEFAULT_DOC_TEMPLATES}.
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
162 */
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
163 protected String[] getDocTemplates() {
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
164 return GroovyDocTemplateInfo.DEFAULT_DOC_TEMPLATES;
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
165 }
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
166
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
167 /**
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
168 * Creates and returns an array of class template classpath entries.
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
169 * <p>
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
170 * This method is meant to be overridden by custom GroovyDoc implementations, using custom class templates.
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
171 *
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
172 * @return an array of class templates, whereas each entry is resolved as classpath entry, defaults to
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
173 * {@link GroovyDocTemplateInfo#DEFAULT_CLASS_TEMPLATES}.
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
174 */
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
175 protected String[] getClassTemplates() {
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
176 return GroovyDocTemplateInfo.DEFAULT_CLASS_TEMPLATES;
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
177 }
a628135958e7 USASR-1307: inititial userdoc plugin/task to produce customizable groovy doc
Dave Smith <smith@nwoca.org>
parents:
diff changeset
178 }