generateDocbook

Jody Winter Jeremie Bresson Ralf D. Müller

1 minute to read

At a Glance

generateDocBook

About This Task

A helper task, generateDocbook generates the intermediate format for convertToDocx<<>> and convertToEpub.

Source

AsciiDocBasics.gradle
task generateDocbook (
        type: AsciidoctorTask,
        group: 'docToolchain',
        description: 'use docbook as asciidoc backend') {

    def sourceFilesDOCBOOK = sourceFiles.findAll {
        'docbook' in it.formats
    }
//    onlyIf {
//        sourceFilesDOCBOOK
//    }

    sources {
        sourceFilesDOCBOOK.each {
            include it.file
            logger.info it.file
        }
    }

    backends = ['docbook']
    doFirst {
        if (sourceFilesDOCBOOK.size()==0) {
            throw new Exception ("""

    >> No source files defined for type docbook.
    >> Please specify at least one inputFile in your docToolchainConfig.groovy
    """)
        }

    }
}