-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
217 lines (187 loc) · 7.19 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven { url "https://maven.restlet.talend.com/" }
}
dependencies {
classpath group: 'com.xmlcalabash', name: 'xmlcalabash1-gradle', version: '1.5.2'
classpath group: 'com.xmlcalabash', name: 'xmlcalabash', version: '1.3.2-100'
}
}
plugins {
id 'base'
id "com.dorongold.task-tree" version "1.4"
}
apply plugin: 'com.xmlcalabash.task'
import com.xmlcalabash.XMLCalabashTask
if (rootProject != project) { project.buildDir = rootProject.buildDir }
project.ext.pathsxml = new File(project.buildDir, 'paths.xml')
project.ext.dataDir = project.hasProperty('dataDir')? project.file(dataDir) : rootProject.file('data/xml')
task setupPaths {
outputs.file(pathsxml)
doLast {
if (!dataDir.exists()) {
throw new FileNotFoundException("Source folder $dataDir not found")
}
project.buildDir.mkdirs()
def sourceURL = dataDir.toURL()
def buildURL = buildDir.toURL()
pathsxml.write("""<?xml version="1.0" encoding="UTF-8"?>
<!-- This file has been generated from the Gradle build -->
<configuration xmlns="http://www.faustedition.net/ns">
<source>$sourceURL</source>
<builddir>$buildURL</builddir>
</configuration>""")
logger.warn("Wrote $pathsxml")
}
}
// ------------- traditional generate all task -> OOMs
task generateAll(type: XMLCalabashTask) {
dependsOn setupPaths
pipeline 'generate-all.xpl'
option 'paths', pathsxml.toURL().toString()
}
// assemble.dependsOn(generateAll)
// -------------- separate tasks for individual parts of the workflow
task collectMetadata(type: XMLCalabashTask) {
dependsOn setupPaths
pipeline 'collect-metadata.xpl'
option 'paths', pathsxml.toURL().toString()
output "result", "$buildDir/faust-transcripts.xml"
}
task readingText(type: XMLCalabashTask) {
dependsOn collectMetadata
pipeline 'generate-reading-text.xpl'
option 'paths', pathsxml.toURL().toString()
input "source", "$buildDir/faust-transcripts.xml"
output "result", "$buildDir/_ignore.xml"
}
task generateSearch(type: XMLCalabashTask) {
dependsOn readingText
pipeline 'generate-search.xpl'
option 'paths', pathsxml.toURL().toString()
input "source", "$buildDir/faust-transcripts.xml"
output "result", "$buildDir/sorted-transcripts.xml"
}
task emendedVersion(type: XMLCalabashTask) {
dependsOn generateSearch
pipeline 'generate-emendations.xpl'
option 'paths', pathsxml.toURL().toString()
input "source", "$buildDir/sorted-transcripts.xml"
output "result", "$buildDir/_ignore1.xml"
outputs.files "$buildDir/emended/*.xml"
}
task variantApp(type: XMLCalabashTask) {
dependsOn emendedVersion
pipeline 'collate-variants.xpl'
option 'paths', pathsxml.toURL().toString()
input "source", "$buildDir/sorted-transcripts.xml"
output "result", "$buildDir/_ignore2.xml"
outputs.files "$buildDir/www/print/variants/*.html"
outputs.files "$buildDir/www/print/variants/1211.html"
}
task generatePrint(type: XMLCalabashTask) {
dependsOn variantApp
pipeline 'generate-print.xpl'
option 'paths', pathsxml.toURL().toString()
input "source", "$buildDir/sorted-transcripts.xml"
inputs.files "$buildDir/emended/*.xml"
inputs.files "$buildDir/www/print/variants/*.html"
output "result", "$buildDir/_ignore3.xml"
outputs.files "$buildDir/www/print/*.html"
outputs.files "$buildDir/www/print/T_6_H.2.html"
}
// sidetracks
task generateApp(type: XMLCalabashTask) {
dependsOn generateSearch
pipeline 'generate-app.xpl'
option 'paths', pathsxml.toURL().toString()
input "source", "$buildDir/sorted-transcripts.xml"
output "result", "$buildDir/_ignore4.xml"
inputs.files "$buildDir/prepared/**/*.xml"
outputs.files "$buildDir/www/app/*.html"
outputs.upToDateWhen { false }
}
task pagesJson(type: XMLCalabashTask) {
dependsOn generateSearch
pipeline 'pages-json.xpl'
option 'paths', pathsxml.toURL().toString()
input "source", "$buildDir/sorted-transcripts.xml"
}
task readingTextExtras(type: XMLCalabashTask) {
dependsOn generatePrint
pipeline 'reading-text-extras.xpl'
option 'paths', pathsxml.toURL().toString()
input "source", "$buildDir/lesetext/faust.xml"
output "citations", "$buildDir/bibliography/cit-text.xml"
outputs.file "$buildDir/www/print/faust.html"
outputs.dir "$buildDir/www/print"
inputs.files 'xslt/text-applist.xsl'
}
task metadataHtml(type: XMLCalabashTask) {
dependsOn generateSearch
pipeline 'metadata-html.xpl'
option 'paths', pathsxml.toURL().toString()
input "source", "$buildDir/faust-transcripts.xml"
output "result", "$buildDir/bibliography/cit-metadata.xml"
inputs.files 'xslt/faust-metadata.xsl', 'xslt/watermark-table.xsl', 'xslt/watermark-labels.xml'
outputs.files "$buildDir/www/meta/*.html", "$buildDir/www/watermark-table.html"
}
task metadataJs(type: XMLCalabashTask) {
dependsOn collectMetadata
dependsOn generateSearch
pipeline 'generate-metadata-js.xpl'
option 'paths', pathsxml.toURL().toString()
}
task testimony(type: XMLCalabashTask) {
dependsOn collectMetadata
pipeline 'testimony.xpl'
option 'paths', pathsxml.toURL().toString()
input "source", "$buildDir/faust-transcripts.xml"
output "result", "$buildDir/bibliography/cit-testimony.xml"
}
task indexesRedirects(type: XMLCalabashTask) {
dependsOn collectMetadata
pipeline 'indexes-and-redirects.xpl'
option 'paths', pathsxml.toURL().toString()
input "source", "$buildDir/faust-transcripts.xml"
}
task bibliography(type: XMLCalabashTask) {
dependsOn metadataHtml, testimony, readingTextExtras
pipeline 'bibliography.xpl'
option 'paths', pathsxml.toURL().toString()
input "source", "$buildDir/bibliography/cit-metadata.xml"
input "source", "$buildDir/bibliography/cit-testimony.xml"
input "source", "$buildDir/bibliography/cit-text.xml"
outputs.files "$buildDir/www/bibliography.html"
}
task paraTable(type: XMLCalabashTask) {
dependsOn emendedVersion
pipeline 'create-para-table.xpl'
option 'paths', pathsxml.toURL().toString()
input "source", "$buildDir/sorted-transcripts.xml"
}
task bargraphData(type: XMLCalabashTask) {
dependsOn generateSearch
pipeline 'bargraph.xpl'
option 'paths', pathsxml.toURL().toString()
input "source", "$buildDir/sorted-transcripts.xml"
inputs.files "$buildDir/prepared/**/*.xml"
outputs.file "$buildDir/www/data/genetic_bar_graph.json"
}
task independentTransforms(type: XMLCalabashTask) {
dependsOn setupPaths
pipeline 'independent-transforms.xpl'
option 'paths', pathsxml.toURL().toString()
inputs.file "$dataDir/archives.xml"
inputs.file "xslt/scenes.xml"
outputs.files "$buildDir/www/data/archives.js", "$buildDir/www/data/scene_line_mapping.js"
}
// ----------------------------------------------------------
task whoami(type: XMLCalabashTask) {
pipeline 'whoami.xpl'
option 'paths', pathsxml.toURL().toString()
}
assemble.dependsOn([generatePrint, generateApp, pagesJson, readingTextExtras, metadataHtml, metadataJs, testimony,
indexesRedirects, bibliography, paraTable, bargraphData, independentTransforms])