-
Notifications
You must be signed in to change notification settings - Fork 40
/
build.gradle
163 lines (132 loc) · 5.27 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
import com.github.jk1.license.render.*
import org.aim42.htmlsanitycheck.check.*
buildscript {
repositories {
maven { url 'http://repository.activeeon.com/content/groups/proactive/' }
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'de.undercouch:gradle-download-task:3.1.2'
classpath 'org.tukaani:xz:1.6'
classpath 'org.ysb33r.gradle:grolifant:0.9'
classpath ('org.asciidoctor:asciidoctor-gradle-plugin:1.6.1') {
exclude group: 'org.ysb33r.gradle', module: 'grolifant'
}
classpath 'xalan:xalan:2.7.2'
classpath 'org.aim42.htmlSanityCheck:org.aim42.htmlSanityCheck.gradle.plugin:1.1.6'
classpath 'com.github.jk1:gradle-license-report:1.7'
}
}
apply plugin: 'de.undercouch.download'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'org.asciidoctor.convert'
apply plugin: 'org.aim42.htmlSanityCheck'
apply plugin: 'com.github.jk1.dependency-license-report'
asciidoctor {
sourceDir file("$projectDir/src/docs")
outputDir = new File("$buildDir/asciidoc")
sources {
include 'user/ProActiveUserGuide.adoc'
include 'JobPlanner/JobPlannerUserGuide.adoc'
include 'PAIO/PAIOUserGuide.adoc'
include 'PEO/PEOUserGuide.adoc'
include 'PSA/PSAUserGuide.adoc'
include 'admin/ProActiveAdminGuide.adoc'
include 'admin/AdminTutorials.adoc'
include 'admin/Catalog.adoc'
include 'index.adoc'
}
resources {
from("$projectDir/src/docs/") {
include 'user/examples/**'
include 'admin/references/automatedInstallScripts/**'
include 'images/**'
include 'tocbot/**'
include 'highlight/**'
}
}
}
asciidoctorj {
version = '2.5.10'
groovyDslVersion = '2.0.2'
}
htmlSanityCheck {
sourceDir = new File( "$buildDir/asciidoc/html5" )
sourceDocuments = fileTree(sourceDir) {
include "**/*.html"
exclude "user/schedulerjob.html"
}
// where to put results of sanityChecks...
checkingResultsDir = new File( "$buildDir/report/htmlchecks" )
checkerClasses = [BrokenCrossReferencesChecker, BrokenHttpLinksChecker, DuplicateIdChecker, ImageMapChecker, MissingAltInImageTagsChecker, MissingImageFilesChecker]
// fail build on errors?
failOnErrors = false
}
licenseReport {
configurations = ['asciidoctor']
renderers = [new InventoryHtmlReportRenderer()]
}
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')
if(project.ext.branch == 'master'){
formattedDateString = currentDate.format('yyyy-MM-dd HH:mm:ss')
}
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 downloadCatalogProperties(type: Download) {
src "https://raw.githubusercontent.com/ow2-proactive/catalog/${project.branch}/src/main/resources/application.properties"
dest file("$projectDir/src/docs/admin/references/properties/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
downloadCatalogProperties.dependsOn downloadSchedulerWebProperties
asciidoctor.dependsOn downloadCatalogProperties
htmlSanityCheck.dependsOn asciidoctor
xsdDoc.dependsOn htmlSanityCheck
build.dependsOn(['xsdDoc'])
defaultTasks 'clean', 'build'