Posted by
owahlen on
May 26, 2014; 4:04pm
URL: https://discuss.asciidoctor.org/Integrate-asciidoctor-gradle-plugin-with-asciidoctor-diagram-tp1769p1773.html
I want to integrate the whole build with gradle since the rest of the project is also build with it.
To circumvent the current limitation of the asciidoctor-gradle plugin I have created the following task in my
build.gradle:
task asciidoctor(type: Exec) {
commandLine 'ruby', 'build.rb',
'-B', 'asciidoc',
'-b', 'deckjs',
'-T', 'asciidoctor-backends/haml',
'-a', 'imagesdir=images',
'-a', "customjs=''",
'-a', "customcss=''",
'-a', "goto=''",
'-a', "menu=''",
'-a', "navigation=''",
'-a', "status=''",
'-a', "toc=''",
'-a', 'source-highlighter=highlightjs',
'asciidoc/cvdb.adoc'
}
And I have created a
build.rb file:
#!/usr/bin/env ruby
require 'rubygems'
require 'bundler/setup'
require 'asciidoctor'
require 'asciidoctor/cli/options'
require 'asciidoctor/cli/invoker'
require 'asciidoctor-diagram'
Asciidoctor::Cli::Invoker.new(*ARGV).invoke!
This works even with the diagram plugin.
Unfortunately source files and target files are now mixed up in my asciidoc folder.
It would be nicer if all files that are needed to run the presentation would be generated and/or copied into the
build folder.
Will this be part of the next gradle-plugin version or is there already an option for the ruby api?