-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathbuild.gradle
More file actions
33 lines (27 loc) · 1.32 KB
/
build.gradle
File metadata and controls
33 lines (27 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import org.gradle.api.tasks.Exec
task initDOT {
String projectDir = "."
doLast {
if(! new File("${projectDir}/dita-ot/oxygen-publishing-engine/").exists()){
//https://www.oxygenxml.com/InstData/PublishingEngine/oxygen-publishing-engine.zip
//https://archives.oxygenxml.com/Nightly/PublishingEngine/oxygen-publishing-engine.zip
ant.get(src: 'https://www.oxygenxml.com/InstData/PublishingEngine/oxygen-publishing-engine.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/licensekey.txt").write(System.getenv( 'LICENSE_KEY' ).replaceAll(" ", "\n"))
}
}
}
task runTransformation(type:Exec, dependsOn: [initDOT]) {
workingDir "${projectDir}/dita-ot/oxygen-publishing-engine/bin"
commandLine "sh", "${projectDir}/dita-ot/oxygen-publishing-engine/bin/dita", "--output=.", "--project", "${projectDir}/../blog-project.xml"
}
task copySite(type: Copy, dependsOn: [runTransformation]) {
from "${projectDir}/dita-ot/oxygen-publishing-engine/bin/site"
into "${projectDir}/../site"
}
task copyResources(type: Copy) {
from "${projectDir}/../resources/"
into "${projectDir}/../site/resources"
}
task dist(dependsOn: [copySite, copyResources])
defaultTasks 'dist'