-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathbuildSchema.xml
More file actions
254 lines (189 loc) · 9.93 KB
/
buildSchema.xml
File metadata and controls
254 lines (189 loc) · 9.93 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
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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." name="buildSchema" default="all">
<description>This build creates the RelaxNG schema, the derived schematron, and the documentation for the static search.</description>
<!--****************************************************************
* *
* PROPERTIES *
* *
****************************************************************-->
<!--Echo separator for output messages-->
<property name="echo.separator" value="*************************************"/>
<!--****************** DIRECTORIES ******************-->
<!--The project directory as supplied by oXygen; if run at the
command line, using -Dproject.dir=../../ -->
<dirname property="project.dir" file="staticSearch.xpr"/>
<!--Schema building dir; equivalent to ${basedir}.-->
<property name="schema.dir" value="${project.dir}/schema"/>
<!--Schema XSLT dir-->
<property name="xsl.dir" value="${project.dir}/xsl"/>
<!--Documentation directory-->
<property name="documentation.dir" value="${project.dir}/docs"/>
<!--Library dir-->
<property name="lib.dir" value="${project.dir}/lib"/>
<!--****************** FILES ******************-->
<!--********* Schemas ********** -->
<!--The base odd-->
<property name="odd.src" value="${schema.dir}/staticSearch.odd"/>
<!--The base odd-->
<property name="odd.patched" value="${schema.dir}/staticSearch_patched.odd"/>
<!--Processed (i.e. combined with P5)-->
<property name="odd.processed" value="${schema.dir}/staticSearch-processed.odd"/>
<!--The LITE ODD-->
<property name="odd.lite" value="${schema.dir}/staticSearch-lite.odd"/>
<!--The HTML documentation-->
<property name="odd.doc" value="${documentation.dir}/staticSearch.html"/>
<!--Result RNG -->
<property name="rng" value="${schema.dir}/staticSearch.rng"/>
<!--Result schematron-->
<property name="sch" value="${schema.dir}/staticSearch.sch"/>
<!--************ XSLTs ************** -->
<!--Local utility ODD to patch our ODD before TEI processing.-->
<property name="patch_tei_odd.xsl" value="${xsl.dir}/patch_tei_odd.xsl"/>
<!--ODD 2 ODD XSLT (from the TEI framework)-->
<property name="odd2odd.xsl" value="https://raw.githubusercontent.com/TEIC/Stylesheets/dev/odds/odd2odd.xsl"/>
<!--ODD 2 RNG XSLT (from the TEI framework)-->
<property name="odd2rng.xsl" value="https://raw.githubusercontent.com/TEIC/Stylesheets/dev/profiles/tei/rng/to.xsl"/>
<!--ODD 2 Schematron XSLT (from the TEI framework)-->
<property name="odd2sch.xsl" value="https://raw.githubusercontent.com/TEIC/Stylesheets/dev/odds/extract-isosch.xsl"/>
<!--ODD 2 HTML XSLT -->
<property name="odd2html.xsl" value="https://raw.githubusercontent.com/TEIC/Stylesheets/dev/odds/odd2html.xsl"/>
<!--ODD 2 Lite XSLT-->
<property name="odd2Lite.xsl" value="https://raw.githubusercontent.com/TEIC/Stylesheets/dev/odds/odd2lite.xsl"/>
<!--Saxon-->
<property name="saxon" value="${lib.dir}/saxon-he-11.7.jar"/>
<!--Condition set for the TEI server, since the TEI site can go down periodically:
If we can reach the TEI guidelines-->
<condition property="useLiveTEI" value="true" else="false">
<http url="https://www.tei-c.org/Vault/P5/"/>
</condition>
<!--Default TEI Server property; fallback if the TEI server isn't working...-->
<condition property="defaultTEIServer" value="https://www.tei-c.org/Vault/P5/" else="https://teijenkins.hcmc.uvic.ca/job/TEIP5/lastSuccessfulBuild/artifact/P5/release/" >
<istrue value="${useLiveTEI}"/>
</condition>
<!--The defaultTEIVersion-->
<condition property="defaultTEIVersion" value="current" else="''">
<istrue value="${useLiveTEI}"/>
</condition>
<property name="tei_all.odd" value="${schema.dir}/tei_all.odd"/>
<property name="tei_all.odd.processed" value="${schema.dir}/tei_all.odd.processed"/>
<property name="tei_all.rng" value="${schema.dir}/tei_all.rng"/>
<!--****************************************************************
* *
* Targets *
* *
****************************************************************-->
<target name="patchOddSrc">
<description>Preprocesses the staticSearch ODD to expand any constructs
or modify features that are not handled by the TEI stylesheets
(e.g. interleave).</description>
<echo message="${echo.separator}"/>
<echo message="Patching the staticSearch ODD ..."/>
<echo message="${echo.separator}"/>
<java jar="${saxon}" fork="true" failonerror="true">
<arg line="-s:${odd.src}"/>
<arg line="-o:${odd.patched}"/>
<arg line="-xsl:'${patch_tei_odd.xsl}'"/>
<arg line="defaultTEIServer=${defaultTEIServer}"/>
<arg line="defaultTEIVersion=${defaultTEIVersion}"/>
</java>
</target>
<target name="odd2processedOdd">
<description>Processes the patched staticSearch ODD against the TEI All using
TEI stylesheets.</description>
<echo message="${echo.separator}"/>
<echo message="Processing the Static Search ODD ..."/>
<echo message="${echo.separator}"/>
<java jar="${saxon}" fork="true" failonerror="true">
<arg line="-s:${odd.patched}"/>
<arg line="-o:${odd.processed}"/>
<arg line="-xsl:'${odd2odd.xsl}'"/>
<arg line="defaultTEIServer=${defaultTEIServer}"/>
<arg line="defaultTEIVersion=${defaultTEIVersion}"/>
</java>
</target>
<target name="odd2rng">
<description>Creates a RelaxNG schema from the processed ODD file.</description>
<echo>Building RelaxNG schema: ${rng}</echo>
<java jar="${saxon}" fork="true" failonerror="true">
<arg line="-s:${odd.processed}"/>
<arg line="-o:${rng}"/>
<arg line="-xsl:'${odd2rng.xsl}'"/>
</java>
</target>
<target name="rng2Sch">
<description>Extracts the schematron from the RelaxNG File</description>
<echo>Extracting schematron from ${rng}</echo>
<java jar="${saxon}" fork="true" failonerror="${true}">
<arg line="-s:${rng}"/>
<arg line="-o:${sch}"/>
<arg line="-xsl:${lib.dir}/schematron/ExtractSchFromRNG-2.xsl"/>
</java>
</target>
<target name="odd2Doc">
<description>
TARGET: odd2Doc
This target turns the ODD into full HTML documentation. This code is taken near
verbatim from Martin Holmes' implementation for the Keats project.
</description>
<echo>${echo.separator}</echo>
<echo>*Create documentation from ODD file.*</echo>
<echo>${echo.separator}</echo>
<!--First, create the Lite output-->
<java jar="${saxon}" fork="true" failonerror="true">
<arg line="-s:${odd.processed}"/>
<arg line="-o:${odd.lite}"/>
<arg line="-xsl:'${odd2Lite.xsl}'"/>
</java>
<!--Now create the first HTML-->
<java jar="${saxon}" fork="true" failonerror="true">
<arg line="-s:${odd.lite}"/>
<arg line="-o:${odd.doc}"/>
<arg line="-xsl:'${odd2html.xsl}'"/>
</java>
<!--And now spiff it up to our standards-->
<java jar="${saxon}" fork="true" failonerror="true">
<arg line="-s:${odd.doc}"/>
<arg line="-o:${odd.doc}_temp"/>
<arg line="-xsl:${xsl.dir}/spiff_up_documentation.xsl"/>
</java>
<move file="${odd.doc}_temp" tofile="${odd.doc}"/>
</target>
<target name="clean">
<echo message="Cleaning up unnecessary temporary documents..."/>
<delete file="${odd.processed}"/>
<delete file="${odd.lite}"/>
</target>
<target name="split">
<description>
target: split
Split the documentation into component HTML pages so that
a) We can demonstrate features in the search
b) Make the search documentation a bit nicer to use/deploy
</description>
<echo message="Splitting the documentation into chapters..."/>
<java jar="${saxon}" fork="true" failonerror="true">
<arg line="-s:${odd.doc}"/>
<arg line="-xsl:${xsl.dir}/split_documentation.xsl"/>
</java>
</target>
<target name="makeSearch">
<echo message="Creating the search..."/>
<!--Now we call the staticSearch build-->
<ant antfile="build.xml" inheritall="false">
<property name="ssConfig" value="config_documentation.xml"/>
</ant>
<copy file="${basedir}/js/ssHighlight.js" todir="${documentation.dir}"/>
</target>
<target name="all" depends="patchOddSrc, odd2processedOdd, odd2rng, rng2Sch, odd2Doc, clean, split, makeSearch">
<description>
TARGET: all
This target is the main driver for the process: it performs all of the regular schema creation
and documentation creation tasks.</description>
</target>
<target name="justDocs" depends="patchOddSrc, odd2processedOdd, odd2Doc">
<description>
TARGET: justDocs
This target just creates the documentation; useful for quick proofing and rapid development.
</description>
</target>
</project>