comparison src/main/groovy/org/ssdt_ohio/gradle/tasks/UserDoc.groovy @ 15:e3c55e83c9a4

USASR-1307: start custom class/property displays
author Dave Smith <smith@nwoca.org>
date Fri, 17 Jan 2014 18:16:29 +0000
parents 9de72de14ab3
children 3741247de37a
comparison
equal deleted inserted replaced
14:9de72de14ab3 15:e3c55e83c9a4
1 package org.ssdt_ohio.gradle.tasks 1 package org.ssdt_ohio.gradle.tasks
2 2
3 import org.codehaus.groovy.tools.groovydoc.ClasspathResourceManager 3 import org.codehaus.groovy.tools.groovydoc.ClasspathResourceManager
4 import org.codehaus.groovy.tools.groovydoc.FileOutputTool 4 import org.codehaus.groovy.tools.groovydoc.FileOutputTool
5 import org.codehaus.groovy.tools.groovydoc.GroovyDocTool 5 import org.codehaus.groovy.tools.groovydoc.GroovyDocTool
6 import org.codehaus.groovy.tools.groovydoc.OutputTool
7 import org.codehaus.groovy.tools.groovydoc.gstringTemplates.GroovyDocTemplateInfo 6 import org.codehaus.groovy.tools.groovydoc.gstringTemplates.GroovyDocTemplateInfo
8 import org.gradle.api.InvalidUserDataException 7 import org.gradle.api.InvalidUserDataException
9 import org.gradle.api.file.FileCollection 8 import org.gradle.api.file.FileCollection
10 import org.gradle.api.file.FileVisitDetails 9 import org.gradle.api.file.FileVisitDetails
11 import org.gradle.api.internal.ClassPathRegistry 10 import org.gradle.api.internal.ClassPathRegistry
28 public UserDoc() { 27 public UserDoc() {
29 getLogging().captureStandardOutput(LogLevel.INFO); 28 getLogging().captureStandardOutput(LogLevel.INFO);
30 classPathRegistry = getServices().get(ClassPathRegistry.class); 29 classPathRegistry = getServices().get(ClassPathRegistry.class);
31 } 30 }
32 31
32 String windowTitle
33
34 String docTitle
35
36 Boolean publicScope = true
37 Boolean protectedScope = false
38 Boolean packageScope = false
39 Boolean privateScope = false
40
33 @TaskAction 41 @TaskAction
34 protected void generate() { 42 protected void generate() {
35 checkGroovyClasspathNonEmpty(getGroovyClasspath().getFiles()); 43 checkGroovyClasspathNonEmpty(getGroovyClasspath().getFiles());
36 44
37 def tmpDir = new File(project.buildDir, "tmp/userdoc") 45 def tmpDir = new File(project.buildDir, "tmp/userdoc")
46 def args = [:] 54 def args = [:]
47 args.sourcepath = tmpDir.toString() 55 args.sourcepath = tmpDir.toString()
48 args.destdir = destinationDir 56 args.destdir = destinationDir
49 57
50 Properties properties = new Properties(); 58 Properties properties = new Properties();
51 // properties.setProperty("windowTitle", windowTitle); 59 properties.setProperty("windowTitle", windowTitle);
52 // properties.setProperty("docTitle", docTitle); 60 properties.setProperty("docTitle", docTitle);
53 // properties.setProperty("footer", footer); 61 // properties.setProperty("footer", footer);
54 // properties.setProperty("header", header); 62 // properties.setProperty("header", header);
55 // checkScopeProperties(properties); 63 // checkScopeProperties(properties);
56 // properties.setProperty("publicScope", publicScope.toString()); 64 properties.setProperty("publicScope", publicScope.toString());
57 // properties.setProperty("protectedScope", protectedScope.toString()); 65 properties.setProperty("protectedScope", protectedScope.toString());
58 // properties.setProperty("packageScope", packageScope.toString()); 66 properties.setProperty("packageScope", packageScope.toString());
59 // properties.setProperty("privateScope", privateScope.toString()); 67 properties.setProperty("privateScope", privateScope.toString());
60 // properties.setProperty("author", author.toString()); 68 // properties.setProperty("author", author.toString());
61 // properties.setProperty("processScripts", processScripts.toString()); 69 // properties.setProperty("processScripts", processScripts.toString());
62 // properties.setProperty("includeMainForScripts", includeMainForScripts.toString()); 70 // properties.setProperty("includeMainForScripts", includeMainForScripts.toString());
63 // properties.setProperty("overviewFile", overviewFile != null ? overviewFile.getAbsolutePath() : ""); 71 // properties.setProperty("overviewFile", overviewFile != null ? overviewFile.getAbsolutePath() : "");
64 // properties.setProperty("charset", charset != null ? charset : ""); 72 // properties.setProperty("charset", charset != null ? charset : "");
65 // properties.setProperty("fileEncoding", fileEncoding != null ? fileEncoding : ""); 73 // properties.setProperty("fileEncoding", fileEncoding != null ? fileEncoding : "");
66 // 74 //
67 75
68 def tool = new GroovyDocTool(new ClasspathResourceManager(), 76 def tool = new GroovyDocTool(new ClasspathResourceManager(this.getClass().getClassLoader()),
69 [tmpDir.getPath()] as String[], 77 [tmpDir.getPath()] as String[],
70 getDocTemplates(), 78 getDocTemplates(),
71 getPackageTemplates(), 79 getPackageTemplates(),
72 getClassTemplates(), [], 80 getClassTemplates(), [],
73 properties) 81 properties)