-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
180 lines (158 loc) · 7.09 KB
/
Copy pathbuild.xml
File metadata and controls
180 lines (158 loc) · 7.09 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
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." name="jonson" xmlns:if="ant:if" xmlns:unless="ant:unless">
<description>
</description>
<property name="echo.separator" value="************************************************"/>
<!-- We'll need access to the date. -->
<tstamp>
<format property="today" pattern="yyyy-MM-dd" locale="en,CA"/>
</tstamp>
<!-- If we only want to run a single diagnostic. -->
<property name="runOnly" value=""/>
<!-- For building only a few documents at one go in the HTML. -->
<property name="docsToBuild" value=""/>
<!-- Folder for HTML website output. -->
<property name="siteDir" value="${basedir}/site"/>
<!-- Location of Saxon jar. -->
<property name="saxon" value="${basedir}/lib/saxon-he-12.jar"/>
<!-- Jing task for validation of XML. -->
<taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask" classpath="${basedir}/lib/jing.jar"/>
<!-- Ant-contrib tasks for foreach loop. -->
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${basedir}/lib/ant-contrib.jar"/>
</classpath>
</taskdef>
<!-- The TEI we regenerate periodically. -->
<fileset dir="${basedir}/" id="xmlSources">
<include name="**/*.xml"/>
</fileset>
<!--No longer used as a separate target. Using fn:transform for this inside the main CEWBJtoLEMDO target-->
<!--<target name="insertToAnchors">
<description>
TARGET insertToAnchors
This target inserts to/target anchor elements for collation and annotation notes into the TEI XML file.
</description>
<echo message="${echo.separator}"/>
<echo message="Inserting to/target anchor elements ..."/>
<java jar="lib/saxon-he-12.jar" fork="true">
<arg value="-s:tei/emdVOL_M.xml"/>
<arg value="-xsl:xsl/insert_anchors.xsl"/>
<arg value="-o:tei/emdVOL_M_with_anchors.xml"/>
<arg value="source-dir=../tei"/>
<arg value="input-file=emdVOL_M.xml"/>
</java>
<echo message="${echo.separator}"/>
<echo message="Anchor elements inserted."/>
</target>-->
<target name="CEWBJtoLEMDO">
<description>
TARGET CEWBJtoLEMDO
This target converts all CEWBJ MSP XML files to LEMDO TEI-XML.
Each work is output to its own subdirectory under tei/ with main/, app/, and crit/ subdirs.
</description>
<echo message="${echo.separator}"/>
<echo message="Converting all CEWBJ XML files to LEMDO TEI..."/>
<!-- Iterate over all *_osp.xml files in src/plays/ -->
<foreach target="convertSingleOSP" param="osp.file">
<path>
<fileset dir="${basedir}/src/plays">
<include name="ver_*_osp.xml"/>
</fileset>
</path>
</foreach>
<!-- Iterate over all *_msp.xml files in src/plays/ -->
<foreach target="convertSingleMSP" param="msp.file">
<path>
<fileset dir="${basedir}/src/plays">
<include name="ver_*_msp.xml"/>
</fileset>
</path>
</foreach>
<echo message="${echo.separator}"/>
<echo message="All LEMDO XML files created."/>
</target>
<target name="convertSingleMSP">
<description>
TARGET convertSingleMSP
Helper target called by CEWBJtoLEMDO to convert a single MSP file.
The msp.file property contains the full path to the file.
</description>
<!-- Extract just the filename from the full path -->
<basename property="msp.filename" file="${msp.file}"/>
<echo message="Processing: ${msp.filename}"/>
<java jar="lib/saxon-he-12.jar" fork="true" failonerror="true">
<arg value="-s:${msp.file}"/>
<arg value="-xsl:xsl/cewbj_to_lemdo_msp.xsl"/>
<arg value="source-filename=${msp.filename}"/>
<arg value="basedir=${basedir}"/>
<arg value="source-dir=src"/>
</java>
</target>
<target name="convertSingleOSP">
<description>
TARGET convertSingleOSP
Helper target to convert a single OSP file.
The osp.file property contains the full path to the file.
</description>
<!-- Extract just the filename from the full path -->
<basename property="osp.filename" file="${osp.file}"/>
<echo message="Processing: ${osp.filename}"/>
<java jar="lib/saxon-he-12.jar" fork="true" failonerror="true">
<arg value="-s:${osp.file}"/>
<arg value="-xsl:xsl/cewbj_to_lemdo_osp.xsl"/>
<arg value="source-filename=${osp.filename}"/>
<arg value="basedir=${basedir}"/>
<arg value="source-dir=src"/>
</java>
</target>
<!--<target name="startFromTei">
<description>
TARGET startFromTei
This runs the build process starting from the TEI source.
This is the most common build process.
</description>
<echo message="${echo.separator}"/>
<echo message="Doing a site build starting from the TEI..."/>
<echo message="${echo.separator}"/>
<antcall target="copyWebResources"/>
<antcall target="TEItoHTML"/>
<antcall target="buildStaticSearch"/>
<!-\- <antcall target="validateSite"/>-\->
<!-\-<antcall target="diagnostics"/>-\->
<!-\-<antcall target="createHtaccess"/>-\->
</target>-->
<target name="TEItoHTML">
<description>
TARGET TEItoHTML
This target builds all the site pages for the output.
</description>
<echo message="${echo.separator}"/>
<echo message="Generating HTML pages for website..."/>
<java fork="true" classname="net.sf.saxon.Transform" classpath="${saxon}" failonerror="true">
<jvmarg value="-Xmx2048m"/>
<arg value="-xsl:xsl/tei_to_html.xsl"/>
<arg value="-it:initial-template"/>
<arg value="baseDir=${basedir}"/>
<arg value="docsToBuild=${docsToBuild}"/>
<arg value="--suppressXsltNamespaceCheck:on"/>
</java>
<echo message="${echo.separator}"/>
<echo message="HTML pages created."/>
</target>
<target name="rngValidateTei">
<description>
TARGET rngValidateTei
This target validates the content of the tei
folder, which contains all the site pages we have created.
These files are validated against the lemdo.rng RelaxNG schema.
</description>
<echo message="${echo.separator}"/>
<echo message="Validating TEI XML content documents with RelaxNG..."/>
<jing compactsyntax="false" rngfile="${basedir}/sch/lemdo.rng" failonerror="true">
<fileset dir="${basedir}/tei">
<include name="**/*.xml"/>
</fileset>
</jing>
</target>
</project>