Index: src/test/org/codehaus/groovy/tools/groovydoc/testfiles/classDocName.html =================================================================== --- src/test/org/codehaus/groovy/tools/groovydoc/testfiles/classDocName.html (revision ) +++ src/test/org/codehaus/groovy/tools/groovydoc/testfiles/classDocName.html (revision ) @@ -0,0 +1,17 @@ + + + + + +<% + def title = classDoc.name() +%> + + +${title} + + + +This is a custom class template. + + Index: src/main/org/codehaus/groovy/ant/Groovydoc.java =================================================================== --- src/main/org/codehaus/groovy/ant/Groovydoc.java (date 1300026576000) +++ src/main/org/codehaus/groovy/ant/Groovydoc.java (revision ) @@ -406,9 +406,9 @@ GroovyDocTool htmlTool = new GroovyDocTool( new ClasspathResourceManager(), // we're gonna get the default templates out of the dist jar file sourcePath.list(), - GroovyDocTemplateInfo.DEFAULT_DOC_TEMPLATES, - GroovyDocTemplateInfo.DEFAULT_PACKAGE_TEMPLATES, - GroovyDocTemplateInfo.DEFAULT_CLASS_TEMPLATES, + getDocTemplates(), + getPackageTemplates(), + getClassTemplates(), links, properties ); @@ -457,4 +457,41 @@ links.add(result); return result; } + + /** + * Creates and returns an array of package template classpath entries.

+ * + * This method is ment to be overridden by custom GroovyDoc implementations, using custom package templates. + * + * @return an arry of package templates, whereas each entry is resolved as classpath entry, defaults to + * {@link GroovyDocTemplateInfo#DEFAULT_PACKAGE_TEMPLATES}. + */ + protected String[] getPackageTemplates() { + return GroovyDocTemplateInfo.DEFAULT_PACKAGE_TEMPLATES; -} + } + + /** + * Creates and returns an array of doc template classpath entries.

+ * + * This method is ment to be overridden by custom GroovyDoc implementations, using custom doc templates. + * + * @return an arry of doc templates, whereas each entry is resolved as classpath entry, defaults to + * {@link GroovyDocTemplateInfo#DEFAULT_DOC_TEMPLATES}. + * + */ + protected String[] getDocTemplates() { + return GroovyDocTemplateInfo.DEFAULT_DOC_TEMPLATES; + } + + /** + * Creates and returns an array of class template classpath entries.

+ * + * This method is ment to be overridden by custom GroovyDoc implementations, using custom class templates. + * + * @return an arry of class templates, whereas each entry is resolved as classpath entry, defaults to + * {@link GroovyDocTemplateInfo#DEFAULT_CLASS_TEMPLATES}. + */ + protected String[] getClassTemplates() { + return GroovyDocTemplateInfo.DEFAULT_CLASS_TEMPLATES; + } +} Index: src/test-resources/groovydoc/buildWithCustomGroovyDoc.xml =================================================================== --- src/test-resources/groovydoc/buildWithCustomGroovyDoc.xml (revision ) +++ src/test-resources/groovydoc/buildWithCustomGroovyDoc.xml (revision ) @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Index: build.gradle =================================================================== --- build.gradle (date 1300026576000) +++ build.gradle (revision ) @@ -69,6 +69,7 @@ testCompile "org.slf4j:jcl-over-slf4j:1.6.0" // testCompile "commons-logging:commons-logging:1.1.1" testCompile "com.thoughtworks.qdox:qdox:1.12" + testCompile "org.apache.ant:ant-testutil:1.8.2" // todo this was provided compile "org.livetribe:livetribe-jsr223:2.0.6" Index: pom.xml =================================================================== --- pom.xml (date 1300026576000) +++ pom.xml (revision ) @@ -834,6 +834,14 @@ 1.6.0 test + + + + org.apache.ant + ant-testutil + 1.8.2 + test +