Skip to content

Instantly share code, notes, and snippets.

@ysb33r
Created August 30, 2014 12:52
Show Gist options
  • Save ysb33r/391801e80dc8aa4ad1c2 to your computer and use it in GitHub Desktop.
Save ysb33r/391801e80dc8aa4ad1c2 to your computer and use it in GitHub Desktop.
A brute-force way to run asciidoctor-pdf under Gradle
buildscript {
repositories {
jcenter()
mavenLocal()
}
dependencies {
classpath 'com.github.jruby-gradle:jruby-gradle-plugin:0.1.2-SNAPSHOT'
classpath 'org.ysb33r.gradle:vfs-gradle-plugin:0.5'
classpath 'commons-httpclient:commons-httpclient:3.1'
}
}
apply plugin: 'vfs'
apply plugin: 'com.github.jruby-gradle.base'
import com.github.jrubygradle.JRubyExec
ext {
downloadDir = new File(buildDir,'download')
apmDir = new File(downloadDir,'asciidoctor-pdf-master')
}
task download {
if(!apmDir.exists()) {
downloadDir.mkdirs()
vfs {
cp 'zip:https://github.com/asciidoctor/asciidoctor-pdf/archive/master.zip', downloadDir, overwrite:true, recursive:true
}
}
}
dependencies {
gems 'rubygems:asciidoctor:1.5.0'
gems 'rubygems:coderay:1.1.0'
gems 'rubygems:prawn:1.0.0'
gems 'rubygems:prawn-templates:0.0.3'
gems 'rubygems:prawn-svg:0.16.0'
gems 'rubygems:slim:2.0.0'
gems 'rubygems:thread_safe:0.3.4'
gems 'rubygems:treetop:1.5.3'
}
task cleanDownload( type : Delete ) {
delete downloadDir
}
task pdf( type: JRubyExec ) {
dependsOn download, jrubyPrepareGems
script new File(apmDir,'bin/asciidoctor-pdf')
configuration 'gems'
scriptArgs '-D',buildDir,'src/asciidoc/slides.adoc'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment