Skip to content

Commit

Permalink
FIXED ysb33r#8 - When passing string to 'template' in configuration, …
Browse files Browse the repository at this point in the history
…it was not recognised as a valid configuration option
  • Loading branch information
ysb33r committed Jun 12, 2014
1 parent 2283f53 commit 824511f
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import org.gradle.api.Plugin
import org.gradle.api.Project

/**
* @author Noam Tenne
* @author Andres Almiray
*/
class AsciidocPlugin implements Plugin<Project> {
void apply(Project project) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit 824511f

Please sign in to comment.