changeset 17:3741247de37a

USASR-1307: add helper to resolve template classpath problem
author smith@nwoca.org
date Thu, 01 Jan 2015 00:01:02 +0000
parents 8400a7db1330
children 4ff2030d2074
files src/main/groovy/org/ssdt_ohio/gradle/doc/tools/UserDocHelper.groovy src/main/groovy/org/ssdt_ohio/gradle/tasks/UserDoc.groovy src/main/resources/org/ssdt_ohio/gradle/userdoc/templates/classDocName.html
diffstat 3 files changed, 25 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/groovy/org/ssdt_ohio/gradle/doc/tools/UserDocHelper.groovy	Thu Jan 01 00:01:02 2015 +0000
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2014.  Ohio Department of Education. - All Rights Reserved.
+ * Unauthorized copying of this file, in any medium, is strictly prohibited.
+ * Written by State Software Development Team (http://ssdt.oecn.k12.oh.us/)
+ */
+
+package org.ssdt_ohio.gradle.doc.tools
+
+import org.codehaus.groovy.groovydoc.GroovyClassDoc
+
+/**
+ * Created by smith on 12/31/2014.
+ */
+class UserDocHelper {
+
+
+    UserClassDocProxy wrap(GroovyClassDoc classDoc) {
+        new UserClassDocProxy().wrap(classDoc)
+    }
+
+}
--- a/src/main/groovy/org/ssdt_ohio/gradle/tasks/UserDoc.groovy	Wed Dec 31 22:35:45 2014 +0000
+++ b/src/main/groovy/org/ssdt_ohio/gradle/tasks/UserDoc.groovy	Thu Jan 01 00:01:02 2015 +0000
@@ -13,6 +13,7 @@
 import org.gradle.api.tasks.OutputDirectory
 import org.gradle.api.tasks.SourceTask
 import org.gradle.api.tasks.TaskAction
+import org.ssdt_ohio.gradle.doc.tools.UserDocHelper
 
 class UserDoc extends SourceTask {
 
@@ -71,7 +72,8 @@
 //        properties.setProperty("overviewFile", overviewFile != null ? overviewFile.getAbsolutePath() : "");
 //        properties.setProperty("charset", charset != null ? charset : "");
 //        properties.setProperty("fileEncoding", fileEncoding != null ? fileEncoding : "");
-//
+
+        properties.put('userdocHelper',new UserDocHelper())
 
         def tool = new GroovyDocTool(new ClasspathResourceManager(this.getClass().getClassLoader()),
                 [tmpDir.getPath()] as String[],
--- a/src/main/resources/org/ssdt_ohio/gradle/userdoc/templates/classDocName.html	Wed Dec 31 22:35:45 2014 +0000
+++ b/src/main/resources/org/ssdt_ohio/gradle/userdoc/templates/classDocName.html	Thu Jan 01 00:01:02 2015 +0000
@@ -12,7 +12,7 @@
 <%
 
     println "Generating for $classDoc (${classDoc.class})"
-    classDoc = new org.ssdt_ohio.gradle.doc.tools.UserClassDocProxy().wrap(classDoc)
+    classDoc = props.get('userdocHelper').wrap(classDoc)
 
     def title = classDoc.name() + (props.docTitle ? " (${props.docTitle})" : "")
     def isVisible = { it.isPublic() || (it.isProtected() && props.protectedScope == 'true') || (!it.isProtected() && !it.isPrivate() && props.packageScope == 'true') || props.privateScope == 'true' }