Added pandoc task.

This commit is contained in:
Erik C. Thauvin 2015-12-04 14:18:29 -08:00
parent 504fdb6bd5
commit 8767f5239c
3 changed files with 475 additions and 6 deletions

View file

@ -2,6 +2,8 @@ apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'application'
import org.apache.tools.ant.taskdefs.condition.Os
defaultTasks 'deploy'
version = '1.0'
@ -45,7 +47,7 @@ jar {
def props = new Properties()
file(buildProps).withInputStream { stream -> props.load(stream) }
version = version + '.' + props.get(buildProp)
archiveName = archiveName.toLowerCase()
archiveName = archiveName.toLowerCase()
manifest.attributes('Main-Class': mainClassName)
}
@ -78,7 +80,24 @@ task deploy(dependsOn: ['build', 'copyToDeploy']) {
mustRunAfter clean
}
task release(dependsOn: ['deploy', 'wrapper']) {
task release(dependsOn: ['deploy', 'pandoc', 'wrapper']) {
group = "Publishing"
description = "Releases new version."
}
}
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
}
else {
commandLine pandoc_cmd
}
standardOutput = new ByteArrayOutputStream()
ext.output = {
return standardOutput.toString()
}
}