| buildscript { |
| dependencies { |
| classpath 'org.ysb33r.gradle:vfs-gradle-plugin:1.0-beta8' |
| classpath 'commons-httpclient:commons-httpclient:3.1' |
| } |
| } |
| |
| plugins { |
| id 'org.asciidoctor.convert' version '1.5.3' |
| id 'com.github.jruby-gradle.base' version '1.2.1' |
| } |
| |
| apply plugin: 'com.github.jruby-gradle.base' |
| apply plugin: 'org.ysb33r.vfs' |
| apply plugin: 'java' |
| apply plugin: 'org.asciidoctor.convert' |
| |
| version = '1.0.0-SNAPSHOT' |
| |
| ext { |
| revealjsVersion = '3.2.0' |
| asciidoctorBackendVersion = 'master' |
| downloadDir = new File(buildDir,'download') |
| templateDir = new File(downloadDir,'templates') |
| revealjsDir = new File(downloadDir,'reveal.js') |
| } |
| |
| repositories { |
| jcenter() |
| } |
| |
| dependencies { |
| gems 'rubygems:slim:3.0.6' |
| gems 'rubygems:thread_safe:0.3.5' |
| } |
| |
| task download << { |
| mkdir downloadDir |
| vfs { |
| cp "zip:https://github.com/asciidoctor/asciidoctor-reveal.js/archive/${asciidoctorBackendVersion}.zip!asciidoctor-reveal.js-${asciidoctorBackendVersion}", |
| templateDir, recursive:true, overwrite:true |
| cp "zip:https://github.com/hakimel/reveal.js/archive/${revealjsVersion}.zip!reveal.js-${revealjsVersion}", |
| revealjsDir, recursive:true, overwrite:true |
| } |
| } |
| |
| download { |
| description "Download extra revealjs resources" |
| outputs.dir templateDir |
| outputs.dir revealjsDir |
| } |
| |
| asciidoctorj { |
| version = '1.5.4' |
| } |
| |
| task('mergeClassesAndResources', type: Copy, dependsOn: 'compileJava') { |
| ext.bundlorInputPath = new File(buildDir, 'asciidoc-sourcedir') |
| inputs.file sourceSets.main.output.classesDir |
| inputs.file sourceSets.main.resources |
| outputs.dir ext.bundlorInputPath |
| from sourceSets.main.output.classesDir |
| from sourceSets.main.resources |
| into ext.bundlorInputPath |
| } |
| |
| asciidoctor { |
| |
| dependsOn jrubyPrepare |
| |
| sources { |
| include 'recipe-accessing-data-mongodb.adoc' |
| } |
| |
| resources { |
| from (sourceDir) { |
| include 'images/**' |
| } |
| from (downloadDir) { |
| include 'reveal.js/**' |
| } |
| } |
| |
| backends 'revealjs' |
| |
| attributes 'build-gradle': file('build-slides.gradle'), |
| 'sourcedir': new File(buildDir, 'asciidoc-sourcedir'), |
| 'endpoint-url': 'http://example.org', |
| 'source-highlighter': 'coderay', |
| 'imagesdir': './images', |
| 'toc': 'left', |
| 'icons': 'font', |
| 'setanchors': '', |
| 'idprefix': '', |
| 'idseparator': '-', |
| 'docinfo1': '', |
| 'revealjs_theme': 'solarized', |
| 'revealjs_transition': 'linear', |
| 'revealjs_history': 'true', |
| 'revealjs_slideNumber': 'true' |
| |
| options template_dirs : [new File(templateDir,'templates/slim').absolutePath ] |
| |
| dependsOn download |
| dependsOn mergeClassesAndResources |
| } |