Skip to content

Instantly share code, notes, and snippets.

@ysb33r
Created December 9, 2014 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ysb33r/9f2d5e9b7b9a8eb32f64 to your computer and use it in GitHub Desktop.
Save ysb33r/9f2d5e9b7b9a8eb32f64 to your computer and use it in GitHub Desktop.
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