Made pandoc task cross-platform.

This commit is contained in:
Erik C. Thauvin 2015-12-05 02:24:57 -08:00
parent 229c9144dd
commit 1b59f8e5dc
3 changed files with 437 additions and 8 deletions

View file

@ -87,17 +87,18 @@ task release(dependsOn: ['deploy', 'pandoc', 'wrapper']) {
task pandoc(type: Exec) {
group = "Documentation"
def pandoc_cmd = 'pandoc --from markdown_github --to html5 -s -o README.html README.md';
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine 'cmd', '/c', pandoc_cmd
def pandoc_args = ['--from', 'markdown_github', '--to', 'html5', '-s', '-o', 'README.html', 'README.md']
if (Os.isFamily(Os.FAMILY_WINDOWS))
{
commandLine(['cmd', '/c', 'pandoc'] + pandoc_args)
}
else {
commandLine pandoc_cmd
else
{
executable '/usr/local/bin/pandoc'
args pandoc_args
}
standardOutput = new ByteArrayOutputStream()
ext.output = {
return standardOutput.toString()
}
}
}