
//------------------------------------------------------------------------------------------------//
//                                                                                                //
//                              : d o c s / b u i l d . g r a d l e                               //
//                                                                                                //
//------------------------------------------------------------------------------------------------//

plugins {
    // Mainly for the clean task
    id 'base'
}

evaluationDependsOn(':app')

def app = project(':app')

// Generate a PDF version of handbook
tasks.register('deletePdf', Delete) {
    delete "build/pdf"
}

tasks.register('handbookPdf', Exec) {
    group = "documentation"
    description = "Generates the PDF version of handbook from GitHub"
    dependsOn('deletePdf')
    workingDir = projectDir
    commandLine 'sh', './pdf/pdf-build.sh', app.version
}

tasks.register('handbookPdfLocalhost', Exec) {
    group = "documentation"
    description = "Generates the PDF version of handbook from local host"
    dependsOn('deletePdf')
    workingDir = projectDir
    commandLine 'sh', './pdf/pdf-build.sh', app.version, 'localhost'
}
