forked from MaelAudren/documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
108 lines (89 loc) · 3.51 KB
/
build.gradle
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'de.undercouch:gradle-download-task:3.1.2'
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.3'
classpath 'xalan:xalan:2.7.2'
}
}
apply plugin: 'de.undercouch.download'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'org.asciidoctor.convert'
asciidoctor {
sourceDir file("$projectDir/src/docs")
outputDir = new File("$buildDir/asciidoc")
sources {
include 'user/ProActiveUserGuide.adoc'
include 'admin/ProActiveAdminGuide.adoc'
include 'admin/AdminTutorials.adoc'
include 'admin/WorkflowCatalog.adoc'
include 'index.adoc'
}
resources {
from("$projectDir/src/docs/") {
include 'user/examples/**'
}
}
}
asciidoctorj {
version = '1.5.1'
}
project.ext.branch = new File("$projectDir/src/docs/version-conf.js").text.split("'")[1]
if (project.ext.branch.endsWith("-SNAPSHOT")) {
project.ext.branch = 'master'
}
def getDate() {
def currentDate = new Date()
def formattedDateString = currentDate.format('yyyy-MM-dd')
return formattedDateString
}
task copyDocs(type: Copy) {
def dateString = getDate()
from ("$projectDir/src/docs/") {
include 'version-conf.js'
filter { line ->
line.replace('date: \'\'', 'date: \''+dateString+'\'')
}
}
into "$buildDir/asciidoc/html5"
}
task removeProperties(type: Delete) {
delete fileTree(dir: "$projectDir/src/docs/admin/references/properties/")
}
import de.undercouch.gradle.tasks.download.Download
task downloadRmProperties(type: Download) {
src "https://raw.githubusercontent.com/ow2-proactive/scheduling/${project.branch}/config/rm/settings.ini"
dest file("$projectDir/src/docs/admin/references/properties/rm.properties")
}
task downloadSchedulerProperties(type: Download) {
src "https://raw.githubusercontent.com/ow2-proactive/scheduling/${project.branch}/config/scheduler/settings.ini"
dest file("$projectDir/src/docs/admin/references/properties/scheduler.properties")
}
task downloadSchedulerWebProperties(type: Download) {
src "https://raw.githubusercontent.com/ow2-proactive/scheduling/${project.branch}/config/web/settings.ini"
dest file("$projectDir/src/docs/admin/references/properties/scheduler-web.properties")
}
task downloadWorkflowCatalogProperties(type: Download) {
src "https://raw.githubusercontent.com/ow2-proactive/workflow-catalog/${project.branch}/src/main/resources/application.properties"
dest file("$projectDir/src/docs/admin/references/properties/workflow-catalog.properties")
}
task xsdDoc(type: JavaExec) {
println file("$projectDir/src/xsd/schedulerjob.xsd").absoluteFile
inputs.files file("$projectDir/src/xsd/schedulerjob.xsd"), file("$projectDir/src/xsd/xs3p.xsl")
outputs.files file("$buildDir/html5/user/schedulerjob.html")
classpath buildscript.configurations.classpath
main 'org.apache.xalan.xslt.Process'
args '-IN', 'src/xsd/schedulerjob.xsd', '-XSL', 'src/xsd/xs3p.xsl', '-OUT', "$buildDir/asciidoc/html5/user/schedulerjob.html"
}
copyDocs.dependsOn removeProperties
downloadRmProperties.dependsOn copyDocs
downloadSchedulerProperties.dependsOn downloadRmProperties
downloadSchedulerWebProperties.dependsOn downloadSchedulerProperties
downloadWorkflowCatalogProperties.dependsOn downloadSchedulerWebProperties
asciidoctor.dependsOn downloadWorkflowCatalogProperties
xsdDoc.dependsOn asciidoctor
build.dependsOn(['xsdDoc'])
defaultTasks 'clean', 'build'