Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
55 lines (47 sloc) 2.3 KB
import org.gradle.api.tasks.Exec
task initDOT {
String projectDir = "."
doLast {
if(! new File("${projectDir}/dita-ot/oxygen-publishing-engine-3.x/").exists()){
//https://www.oxygenxml.com/InstData/PublishingEngine/oxygen-publishing-engine-3.x.zip
ant.get(src: 'http://mirror.oxygenxml.com/maven-nightly/com/oxygenxml/oxygen-publishing-engine-3.x/22.1-SNAPSHOT/oxygen-publishing-engine-3.x-22.1-SNAPSHOT-package-full.zip', dest: "${projectDir}/dita-ot.zip", skipexisting: 'true')
ant.unzip(src: "${projectDir}/dita-ot.zip", dest: 'dita-ot')
new File("${projectDir}/dita-ot/oxygen-publishing-engine-3.x/licensekey.txt").write(System.getenv( 'LICENSE_KEY' ).replaceAll(" ", "\n"))
}
}
}
task runTransformation(type:Exec, dependsOn: [initDOT]) {
workingDir "${projectDir}/dita-ot/oxygen-publishing-engine-3.x/bin"
commandLine "sh", "${projectDir}/dita-ot/oxygen-publishing-engine-3.x/bin/dita", "--project", "${projectDir}/../blog-project.xml"
}
task copySite(type: Copy, dependsOn: [runTransformation]) {
from "${projectDir}/dita-ot/oxygen-publishing-engine-3.x/bin/out/site"
into "${projectDir}/../site"
}
task initValidation {
String projectDir = "."
doLast {
if(! new File("${projectDir}/extracted/oxygen/").exists()){
ant.get(src: 'https://www.oxygenxml.com/InstData/Editor/All/oxygen.tar.gz', dest: "${projectDir}/oxygen.tar.gz", skipexisting: 'true')
ant.untar(src: "${projectDir}/oxygen.tar.gz", dest: "${projectDir}/extracted", compression: 'gzip')
new File("${projectDir}/extracted/oxygen/scriptinglicensekey.txt").write(System.getenv( 'SCRIPTING_LICENSE_KEY' ).replaceAll(" ", "\n"))
}
}
}
task runValidation(type:Exec, dependsOn: [initValidation]) {
workingDir "${projectDir}/extracted/oxygen"
ignoreExitValue true
commandLine "sh", "${projectDir}/extracted/oxygen/validateCheckDITA.sh", "-i", "${projectDir}/../oxygen_xml_blog.ditamap", "-r", "${projectDir}/../site/validationReport.xml"
}
task postProcessValidation(dependsOn: [runValidation]) {
String projectDir = "."
doLast {
ant.replace(
file: '${projectDir}/../../site/validationReport.xml',
token: '<?xml version="1.0" encoding="UTF-8"?>',
value: '<?xml-stylesheet type="text/css" href="report.css"?>'
)
}
}
task dist(dependsOn: [copySite, postProcessValidation])
defaultTasks 'dist'
You can’t perform that action at this time.