-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.xml
204 lines (181 loc) · 9.9 KB
/
build.xml
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
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." name="WeGA-ODD" default="all">
<!-- import default properties from file -->
<property file="local.build.properties"/>
<property file="build.properties"/>
<condition property="lang" value="${lang}" else="de">
<isset property="lang"/>
</condition>
<target name="tei" depends="biblio,diaries,documents,letters,news,orgs,persons,places,sourcesTEI,thematicCommentaries,var,wega_all,writings"/>
<target name="mei" depends="works"/>
<target name="all" depends="tei,mei"/>
<target name="init">
<mkdir dir="${compiledODD.dir}"/>
</target>
<target name="clean">
<delete>
<fileset dir="schema/en">
<include name="*.isosch"/>
</fileset>
</delete>
</target>
<target name="biblio" depends="init">
<antcall target="process">
<param name="inputFile" value="${basedir}/src/Guidelines/guidelines-de.xml"/>
<param name="outputFileRNG" value="${basedir}/schema/${lang}/wegaBiblio.rng"/>
<param name="outputFileSchematron" value="${basedir}/schema/${lang}/wegaBiblio.isosch"/>
<param name="selectedSchema" value="wegaBiblio"/>
</antcall>
</target>
<target name="diaries" depends="init">
<antcall target="process">
<param name="inputFile" value="${basedir}/src/Guidelines/guidelines-de.xml"/>
<param name="outputFileRNG" value="${basedir}/schema/${lang}/wegaDiaries.rng"/>
<param name="outputFileSchematron" value="${basedir}/schema/${lang}/wegaDiaries.isosch"/>
<param name="selectedSchema" value="wegaDiaries"/>
</antcall>
</target>
<target name="documents" depends="init">
<antcall target="process">
<param name="inputFile" value="${basedir}/src/Guidelines/guidelines-de.xml"/>
<param name="outputFileRNG" value="${basedir}/schema/${lang}/wegaDocuments.rng"/>
<param name="outputFileSchematron" value="${basedir}/schema/${lang}/wegaDocuments.isosch"/>
<param name="selectedSchema" value="wegaDocuments"/>
</antcall>
</target>
<target name="letters" depends="init">
<antcall target="process">
<param name="inputFile" value="${basedir}/src/Guidelines/guidelines-de.xml"/>
<param name="outputFileRNG" value="${basedir}/schema/${lang}/wegaLetters.rng"/>
<param name="outputFileSchematron" value="${basedir}/schema/${lang}/wegaLetters.isosch"/>
<param name="selectedSchema" value="wegaLetters"/>
</antcall>
</target>
<target name="news" depends="init">
<antcall target="process">
<param name="inputFile" value="${basedir}/src/Guidelines/guidelines-de.xml"/>
<param name="outputFileRNG" value="${basedir}/schema/${lang}/wegaNews.rng"/>
<param name="outputFileSchematron" value="${basedir}/schema/${lang}/wegaNews.isosch"/>
<param name="selectedSchema" value="wegaNews"/>
</antcall>
</target>
<target name="orgs" depends="init">
<antcall target="process">
<param name="inputFile" value="${basedir}/src/Guidelines/guidelines-de.xml"/>
<param name="outputFileRNG" value="${basedir}/schema/${lang}/wegaOrgs.rng"/>
<param name="outputFileSchematron" value="${basedir}/schema/${lang}/wegaOrgs.isosch"/>
<param name="selectedSchema" value="wegaOrgs"/>
</antcall>
</target>
<target name="persons" depends="init">
<antcall target="process">
<param name="inputFile" value="${basedir}/src/Guidelines/guidelines-de.xml"/>
<param name="outputFileRNG" value="${basedir}/schema/${lang}/wegaPersons.rng"/>
<param name="outputFileSchematron" value="${basedir}/schema/${lang}/wegaPersons.isosch"/>
<param name="selectedSchema" value="wegaPersons"/>
</antcall>
</target>
<target name="places" depends="init">
<antcall target="process">
<param name="inputFile" value="${basedir}/src/Guidelines/guidelines-de.xml"/>
<param name="outputFileRNG" value="${basedir}/schema/${lang}/wegaPlaces.rng"/>
<param name="outputFileSchematron" value="${basedir}/schema/${lang}/wegaPlaces.isosch"/>
<param name="selectedSchema" value="wegaPlaces"/>
</antcall>
</target>
<target name="sourcesTEI" depends="init">
<antcall target="process">
<param name="inputFile" value="${basedir}/src/Guidelines/guidelines-de.xml"/>
<param name="outputFileRNG" value="${basedir}/schema/${lang}/wegaSourcesTEI.rng"/>
<param name="outputFileSchematron" value="${basedir}/schema/${lang}/wegaSourcesTEI.isosch"/>
<param name="selectedSchema" value="wegaSourcesTEI"/>
</antcall>
</target>
<target name="thematicCommentaries" depends="init">
<antcall target="process">
<param name="inputFile" value="${basedir}/src/Guidelines/guidelines-de.xml"/>
<param name="outputFileRNG" value="${basedir}/schema/${lang}/wegaThematicCommentaries.rng"/>
<param name="outputFileSchematron" value="${basedir}/schema/${lang}/wegaThematicCommentaries.isosch"/>
<param name="selectedSchema" value="wegaThematicCommentaries"/>
</antcall>
</target>
<target name="var" depends="init">
<antcall target="process">
<param name="inputFile" value="${basedir}/src/Guidelines/guidelines-de.xml"/>
<param name="outputFileRNG" value="${basedir}/schema/${lang}/wegaVar.rng"/>
<param name="outputFileSchematron" value="${basedir}/schema/${lang}/wegaVar.isosch"/>
<param name="selectedSchema" value="wegaVar"/>
</antcall>
</target>
<target name="wega_all" depends="init">
<antcall target="process">
<param name="inputFile" value="${basedir}/src/Guidelines/guidelines-de.xml"/>
<param name="outputFileRNG" value="${basedir}/schema/${lang}/wega_all.rng"/>
<param name="outputFileSchematron" value="${basedir}/schema/${lang}/wega_all.isosch"/>
<param name="selectedSchema" value="wega_all"/>
</antcall>
</target>
<target name="works" depends="init">
<antcall target="process">
<param name="inputFile" value="${basedir}/src/Guidelines/guidelines-de.xml"/>
<param name="outputFileRNG" value="${basedir}/schema/${lang}/wegaWorks.rng"/>
<param name="outputFileSchematron" value="${basedir}/schema/${lang}/wegaWorks.isosch"/>
<param name="selectedSchema" value="wegaWorks"/>
<param name="source" value="${mei.source}"/>
</antcall>
</target>
<target name="writings" depends="init">
<antcall target="process">
<param name="inputFile" value="${basedir}/src/Guidelines/guidelines-de.xml"/>
<param name="outputFileRNG" value="${basedir}/schema/${lang}/wegaWritings.rng"/>
<param name="outputFileSchematron" value="${basedir}/schema/${lang}/wegaWritings.isosch"/>
<param name="selectedSchema" value="wegaWritings"/>
</antcall>
</target>
<target name="process">
<basename property="inputFile.basename" file="${inputFile}" suffix=".xml"/>
<!-- TEI is considered default source -->
<condition property="source" value="${source}" else="${tei.source}">
<isset property="source"/>
</condition>
<sequential>
<echo>Expanding ODD file</echo>
<xslt force="yes" style="${stylesheets.dir}/odds/odd2odd.xsl"
in="${inputFile}" out="${compiledODD.dir}/${inputFile.basename}-${selectedSchema}.compiled.xml">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
</factory>
<param name="lang" expression="${lang}" if="lang"/>
<param name="defaultSource" expression="${source}"/>
<param name="selectedSchema" expression="${selectedSchema}"/>
</xslt>
<echo>Creating RelaxNG schema</echo>
<xslt force="yes" style="${stylesheets.dir}/profiles/default/rng/to.xsl"
in="${compiledODD.dir}/${inputFile.basename}-${selectedSchema}.compiled.xml" out="${outputFileRNG}">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
</factory>
<param name="inputDir" expression="${basedir}/"/>
<!-- supply name of language-->
<param name="lang" expression="${lang}" if="lang"/>
<param name="doclang" expression="${lang}" if="lang"/>
<param name="documentationLanguage" expression="${lang}" if="lang"/>
<!-- emit some diagnostics"-->
<param name="debug" expression="${debug}" if="debug"/>
<!-- be verbose-->
<param name="verbose" expression="${verbose}" if="verbose"/>
</xslt>
<echo>Extracting Schematron rules</echo>
<xslt processor="trax" force="yes"
style="${stylesheets.dir}/profiles/default/schematron/to.xsl"
in="${compiledODD.dir}/${inputFile.basename}-${selectedSchema}.compiled.xml" out="${outputFileSchematron}">
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
<!--
the param lang needs to be a fixed value 'en' (since recently?),
since there are no constraints in other languages
-->
<param name="lang" expression="en"/>
</xslt>
</sequential>
</target>
</project>