Skip to content

Instantly share code, notes, and snippets.

@ysb33r
Created Dec 9, 2014
Embed
What would you like to do?
Asciidoctor-packt with Gradle
// A minimum Gradle file to get you started with asciidoctor-packt
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.ysb33r.gradle:vfs-gradle-plugin:1.0-beta1'
classpath 'commons-httpclient:commons-httpclient:3.1'
}
}
plugins {
id "org.asciidoctor.convert" version "1.5.2"
}
apply plugin : 'org.asciidoctor.gradle.asciidoctor'
apply plugin: 'org.ysb33r.vfs'
ext {
asciidoctorPacktVersion = 'master'
downloadDir = new File(buildDir,'download')
templateDir = new File(downloadDir,'templates')
}
repositories {
jcenter()
}
task download << {
mkdir downloadDir
vfs {
cp "zip:https://github.com/gregturn/asciidoctor-packt/archive/${asciidoctorPacktVersion}.zip!asciidoctor-packt-${asciidoctorPacktVersion}",
templateDir, recursive:true, overwrite:true
}
}
download {
outputs.dir templateDir
}
asciidoctor {
backends 'packt'
options eruby: 'erubis'
options template_dirs : [ "${templateDir}/slim" ]
dependsOn download
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment