| buildscript { |
| repositories { |
| jcenter() |
| } |
| } |
| |
| plugins { |
| id 'org.asciidoctor.jvm.convert' version '3.3.2' |
| id 'org.asciidoctor.jvm.pdf' version '3.3.2' |
| } |
| |
| repositories { |
| jcenter() |
| } |
| |
| def mainADoc = 'GettingStarted_mdmblProject' |
| def resultPdfName = 'GettingStarted_mdmbl' |
| |
| asciidoctor { |
| options doctype: 'book' |
| attributes toclevels: 4, toc: 'left', sectnums: 'numbered' |
| sourceDir file('src') |
| sources { |
| include "$mainADoc" + ".adoc" |
| } |
| outputDir file("$buildDir/docs") |
| baseDirFollowsSourceDir() |
| } |
| |
| pdfThemes { |
| local 'openMDM', { |
| themeDir = file('themes') |
| themeName = 'openMDM' |
| } |
| } |
| |
| asciidoctorPdf { |
| theme 'openMDM' |
| options doctype: 'book' |
| attributes toclevels: 4, toc: 'auto', sectnums: 'numbered', 'chapter-label': '' |
| sourceDir file('src') |
| sources { |
| include "$mainADoc" + ".adoc" |
| } |
| outputDir file("$buildDir/pdf") |
| baseDirFollowsSourceDir() |
| } |
| |
| task copyPdf(type: Copy) { |
| from file("$buildDir/pdf/$mainADoc" + ".pdf") |
| into file("$projectDir") |
| |
| rename '.*', "$resultPdfName" + ".pdf" |
| } |
| |
| asciidoctorPdf.finalizedBy(copyPdf) |
| build.dependsOn(asciidoctorPdf) |
| build.dependsOn(asciidoctor) |