From 824511ff7fcfdcade3ac86d51a56b724497f5a54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schalk=20W=2E=20Cronj=C3=A9?= Date: Thu, 12 Jun 2014 23:01:36 +0100 Subject: [PATCH] FIXED #8 - When passing string to 'template' in configuration, it was not recognised as a valid configuration option --- .../ysb33r/gradle/a2x/AsciidocPlugin.groovy | 2 -- .../org/ysb33r/gradle/doxygen/Doxygen.groovy | 9 +++++ .../gradle/doxygen/DoxygenTaskSpec.groovy | 35 +++++++++++++++++++ 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/a2x/src/main/groovy/org/ysb33r/gradle/a2x/AsciidocPlugin.groovy b/a2x/src/main/groovy/org/ysb33r/gradle/a2x/AsciidocPlugin.groovy index e9cd382..5c5b0ca 100755 --- a/a2x/src/main/groovy/org/ysb33r/gradle/a2x/AsciidocPlugin.groovy +++ b/a2x/src/main/groovy/org/ysb33r/gradle/a2x/AsciidocPlugin.groovy @@ -19,8 +19,6 @@ import org.gradle.api.Plugin import org.gradle.api.Project /** - * @author Noam Tenne - * @author Andres Almiray */ class AsciidocPlugin implements Plugin { void apply(Project project) { diff --git a/doxygen/src/main/groovy/org/ysb33r/gradle/doxygen/Doxygen.groovy b/doxygen/src/main/groovy/org/ysb33r/gradle/doxygen/Doxygen.groovy index 172ae94..95c03fa 100644 --- a/doxygen/src/main/groovy/org/ysb33r/gradle/doxygen/Doxygen.groovy +++ b/doxygen/src/main/groovy/org/ysb33r/gradle/doxygen/Doxygen.groovy @@ -100,6 +100,15 @@ class Doxygen extends SourceTask { templateFile = tmpl } + /** Sets the template Doxyfile to be used. If not supplied a default one will be + * generated to be used as a template. + * + * @param tmpl Template Doxyfile + */ + void template(final String tmpl) { + template new File(tmpl) + } + /** Allows for one more image paths to be set * * @param paths diff --git a/doxygen/src/test/groovy/org/ysb33r/gradle/doxygen/DoxygenTaskSpec.groovy b/doxygen/src/test/groovy/org/ysb33r/gradle/doxygen/DoxygenTaskSpec.groovy index fc996b3..48cab93 100644 --- a/doxygen/src/test/groovy/org/ysb33r/gradle/doxygen/DoxygenTaskSpec.groovy +++ b/doxygen/src/test/groovy/org/ysb33r/gradle/doxygen/DoxygenTaskSpec.groovy @@ -250,5 +250,40 @@ class DoxygenTaskSpec extends spock.lang.Specification { doxCustom.inputs.files.contains(DOXY_TEMPLATE) } + @IgnoreIf( {DO_NOT_RUN_DOXYGEN_EXE_TESTS} ) + def "When 'template' is supplied as a string, configuration should still work"() { + given: + Project proj = ProjectBuilder.builder().withName('DoxygenTaskSpec').build() + proj.buildDir = TESTFSWRITEROOT + def doxCustom = proj.task('doxygen', type: Doxygen ) + + doxCustom.configure { + source new File(TESTFSREADROOT,'sample-cpp') + outputDir new File(TESTFSWRITEROOT,'docs') + + generate_xml false + generate_latex false + generate_html true + have_dot false + + template DOXY_TEMPLATE.absolutePath + + if(System.getProperty('DOXYGEN_PATH')) { + executables { + doxygen System.getProperty('DOXYGEN_PATH') + } + } + } + + doxCustom.exec() + + def lines = new File(proj.buildDir,'tmp/DoxygenTaskSpec.doxyfile').text.readLines() + + expect: + new File(TESTFSWRITEROOT,'docs/html').exists() + new File(TESTFSWRITEROOT,'docs/html/index.html').exists() + lines.find { 'FILE_PATTERNS ='} + doxCustom.inputs.files.contains(DOXY_TEMPLATE) + } }