-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.xml
395 lines (368 loc) · 20.8 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
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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
<?xml version="1.0" encoding="UTF-8"?>
<!-- This is a build file for Apache ant (http://ant.apache.org/). This has been tested with Ant 1.7. -->
<project name="wcag20" basedir="." default="usage">
<description>Generate WCAG 2.0 and related documents</description>
<!-- Load overriding properties -->
<xmlproperty file="build.properties" keeproot="false" semanticattributes="true"/>
<!-- The following properties need to be set appropriately before doing a build - they should all be overridden by the above property file, but are kept here to serve as defaults -->
<property name="pubdate" value="20090123" description="Publication date of this version of the documents, in YYYYMMDD format, used to generate the output directory"/>
<property name="pubdate.previous" value="20081211" description="Publication date of a previous version of the documents, used to find the folder from which to copy static files (images, CSS) into the new output directory"/>
<property name="guidelines.w3c-version" value="REC" description="W3C version of the guidelines, used to generate the output directory"/>
<property name="understanding.w3c-version" value="NOTE" description="W3C version of understanding, used to generate the output directory"/>
<property name="techniques.w3c-version" value="NOTE" description="W3C version of the techniques, used to generate the output directory"/>
<property name="guidelines.w3c-version.previous" value="REC" description="W3C version of a previous version of the guidelines, used to find the folder from which to copy static files (images, CSS) into the new output directory"/>
<property name="understanding.w3c-version.previous" value="NOTE" description="W3C version of a previous version of understanding, used to find the folder from which to copy static files (images, CSS) into the new output directory"/>
<property name="techniques.w3c-version.previous" value="NOTE" description="W3C version of a previous version of the techniques, used to find the folder from which to copy static files (images, CSS) into the new output directory"/>
<property name="outputdir" location="." description="Directory within which the output folders are created, normally "." unless doing TR in which case it is "../../../TR/<YYYY>""/>
<property name="outputdir.previous" location="." description="Directory in which previous build containing static files is located, almost always ".""/>
<property name="slices" value="true" description="Set to "true" to output mutliple-file versions"/>
<property name="monolithic" value="true" description="Set to "true" to output single-file version"/>
<property name="diffspec" value="false" description="Set to "true" to output a diff version (as a separate copy of monolithic versions, but as the only format for multiple-file versions)"/>
<property name="xslt.factory" value="net.sf.saxon.TransformerFactoryImpl" description="Class name of the XSLT transformer factory, which sets which XSLT engine to use; must be an XSLT 2.0 processor"/>
<!-- The following properties usually do not need to be adjusted -->
<property name="cvs.basedir" location="../../../../../"/>
<property name="outputdir.guidelines" location="${outputdir}/${guidelines.w3c-version}-WCAG20-${pubdate}"/>
<property name="outputdir.understanding" location="${outputdir}/${understanding.w3c-version}-UNDERSTANDING-WCAG20-${pubdate}"/>
<property name="outputdir.techniques" location="${outputdir}/${techniques.w3c-version}-WCAG20-TECHS-${pubdate}"/>
<property name="outputdir.quickref" location="../../WCAG20/quickref/${pubdate}"/>
<property name="outputdir.guidelines.previous" location="${outputdir.previous}/${guidelines.w3c-version.previous}-WCAG20-${pubdate.previous}"/>
<property name="outputdir.understanding.previous" location="${outputdir.previous}/${understanding.w3c-version.previous}-UNDERSTANDING-WCAG20-${pubdate.previous}"/>
<property name="outputdir.techniques.previous" location="${outputdir.previous}/${techniques.w3c-version.previous}-WCAG20-TECHS-${pubdate.previous}"/>
<property name="outputdir.quickref.previous" location="../../WCAG20/quickref/${pubdate.previous}"/>
<property name="outputdir.zip" location="../../WCAG20/versions"/>
<property name="outputdir.zip.guidelines" location="${outputdir.zip}/guidelines"/>
<property name="outputdir.zip.understanding" location="${outputdir.zip}/understanding"/>
<property name="outputdir.zip.techniques" location="${outputdir.zip}/techniques"/>
<!--
<path id="saxon.classpath">
<fileset dir="C:\Documents\Java\saxonb9-1-0-2j">
<include name="saxon9.jar"/>
<include name="saxon9-dom.jar"/>
<include name="saxon9-xpath.jar"/>
</fileset>
<pathelement location="C:\Documents\Java\saxon-ant9-1\saxon9-ant.jar"/>
</path>
-->
<!-- Saxon XSLT -->
<!-- This task is not needed since Saxon can be called with the transformer factory, though it provides additional features -->
<!--
<taskdef name="saxon-xslt" classname="net.sf.saxon.ant.AntTransform">
<classpath refid="saxon.classpath"/>
</taskdef>
-->
<target name="usage">
<echo level="info">Usage: "ant <target>" to execute a build task
Enter "ant -projecthelp" to get list of available build tasks</echo>
</target>
<target name="init">
<!-- Set properties that affect whether diff and slices output, done here because 1) the conditions in targets can only depend on whether a property is set, not its value, while it is more convenient to define the property so it isn't forgotten about, and 2) the conditions intersect, and this resolves those. -->
<condition property="monolithic.nodiff">
<equals arg1="${monolithic}" arg2="true"/>
</condition>
<condition property="monolithic.diff">
<and>
<equals arg1="${monolithic}" arg2="true"/>
<equals arg1="${diffspec}" arg2="true"/>
</and>
</condition>
<condition property="slices.nodiff">
<and>
<equals arg1="${slices}" arg2="true"/>
<not>
<equals arg1="${diffspec}" arg2="true"/>
</not>
</and>
</condition>
<condition property="slices.diff">
<and>
<equals arg1="${slices}" arg2="true"/>
<equals arg1="${diffspec}" arg2="true"/>
</and>
</condition>
<!-- For now, not doing CVS within the build process -->
<!--<cvs command="update"/>-->
</target>
<!--<target name="clean" description="Clean up any temp files"></target>-->
<!-- === Static content === -->
<target name="guidelines.static" description="Copy static files for guidelines into new directory" depends="init">
<copy todir="${outputdir.guidelines}">
<fileset dir="${outputdir.guidelines.previous}">
<exclude name="*.html"/>
<exclude name="CVS/"/>
</fileset>
</copy>
</target>
<target name="understanding.static" description="Copy static files for understanding into new directory" depends="init">
<copy todir="${outputdir.understanding}">
<fileset dir="${outputdir.understanding.previous}">
<exclude name="*.html"/>
<exclude name="CVS/"/>
</fileset>
</copy>
</target>
<target name="techniques.static" description="Copy static files for techniques into new directory" depends="init">
<copy todir="${outputdir.techniques}">
<fileset dir="${outputdir.techniques.previous}">
<exclude name="*.html"/>
<exclude name="CVS/"/>
</fileset>
</copy>
</target>
<target name="quickref.static" description="Copy static files for quickref into new directory" depends="init">
<copy todir="${outputdir.quickref}">
<fileset dir="${outputdir.quickref.previous}">
<exclude name="*.html"/>
<exclude name="*.php"/>
<exclude name="CVS/"/>
</fileset>
</copy>
</target>
<target name="all.static" description="Copy static files into new directories" depends="guidelines.static, understanding.static, techniques.static, quickref.static"/>
<!-- === HTML versions === -->
<!-- Guidelines -->
<target name="guidelines.single" depends="init">
<mkdir dir="${outputdir.guidelines}"/>
<xslt in="sources/wcag2-src.xml" out="${outputdir.guidelines}/Overview.html" style="sources/diffspec.xsl" force="true">
<factory name="${xslt.factory}"/>
<param name="show.diff.markup" expression="0"/>
<param name="show.issue.links" expression="0"/>
<param name="glthisversion" expression="./Overview.html"/>
<param name="guidethisversion" expression="${understanding.uri}" if="understanding.uri"/>
<param name="techsthisversion" expression="${techniques.uri}" if="techniques.uri"/>
</xslt>
</target>
<target name="guidelines.single.diff" depends="init" if="monolithic.diff">
<mkdir dir="${outputdir.guidelines}"/>
<xslt in="sources/wcag2-src.xml" out="${outputdir.guidelines}/Overview-diff.html" style="sources/diffspec.xsl" force="true">
<factory name="${xslt.factory}"/>
<param name="show.diff.markup" expression="1"/>
<param name="show.issue.links" expression="1"/>
<param name="glthisversion" expression="."/>
<param name="guidethisversion" expression="${understanding.uri}" if="understanding.uri"/>
<param name="techsthisversion" expression="${techniques.uri}" if="techniques.uri"/>
</xslt>
</target>
<target name="guidelines" depends="guidelines.single, guidelines.single.diff" description="Generate Guidelines"/>
<!-- Understanding -->
<target name="understanding.single" depends="init">
<mkdir dir="${outputdir.understanding}"/>
<xslt in="sources/guide-to-wcag2-src.xml" out="${outputdir.understanding}/complete.html" style="sources/diffspec-howto.xsl" force="true">
<factory name="${xslt.factory}"/>
<param name="show.diff.markup" expression="0"/>
<param name="show.issue.links" expression="0"/>
<param name="glthisversion" expression="${guidelines.uri}" if="guidelines.uri"/>
<param name="guidethisversion" expression="./"/>
<param name="techsthisversion" expression="${techniques.uri}" if="techniques.uri"/>
</xslt>
</target>
<target name="understanding.single.diff" depends="init" if="monolithic.diff">
<mkdir dir="${outputdir.understanding}"/>
<xslt in="sources/guide-to-wcag2-src.xml" out="${outputdir.understanding}/complete-diff.html" style="sources/diffspec-howto.xsl" force="true">
<factory name="${xslt.factory}"/>
<param name="show.diff.markup" expression="1"/>
<param name="show.issue.links" expression="1"/>
<param name="glthisversion" expression="${guidelines.uri}" if="guidelines.uri"/>
<param name="guidethisversion" expression="."/>
<param name="techsthisversion" expression="${techniques.uri}" if="techniques.uri"/>
</xslt>
</target>
<target name="understanding.slices" depends="init">
<mkdir dir="${outputdir.understanding}"/>
<xslt in="sources/guide-to-wcag2-src.xml" out="temp.html" style="sources/slices-understanding-common.xsl" force="true">
<factory name="${xslt.factory}"/>
<param name="show.diff.markup" expression="0" if="slices.nodiff"/>
<param name="show.issue.links" expression="0" if="slices.nodiff"/>
<param name="show.diff.markup" expression="1" if="slices.diff"/>
<param name="show.issue.links" expression="1" if="slices.diff"/>
<param name="output.dir" expression="${outputdir.understanding}"/>
<param name="glthisversion" expression="${guidelines.uri}" if="guidelines.uri"/>
<param name="guidethisversion" expression="./"/>
<param name="techsthisversion" expression="${techniques.uri}" if="techniques.uri"/>
</xslt>
<delete file="temp.html"/>
</target>
<target name="understanding" depends="understanding.single, understanding.single.diff, understanding.slices" description="Generate Understanding"/>
<!-- Techniques -->
<target name="techniques-merge" depends="init">
<xslt in="sources/wcag20-merged-techs.xml" out="sources/merged-techs.xml" style="sources/techs-merge.xslt">
<factory name="${xslt.factory}"/>
</xslt>
</target>
<target name="techniques.single" depends="init, techniques-merge">
<mkdir dir="${outputdir.techniques}"/>
<xslt in="sources/merged-techs.xml" out="${outputdir.techniques}/complete.html" style="sources/diffspec-tech.xsl" force="true">
<factory name="${xslt.factory}"/>
<param name="show.diff.markup" expression="0"/>
<param name="show.issue.links" expression="0"/>
<param name="glthisversion" expression="${guidelines.uri}" if="guidelines.uri"/>
<param name="guidethisversion" expression="${understanding.uri}" if="understanding.uri"/>
<param name="techsthisversion" expression="."/>
</xslt>
</target>
<target name="techniques.single.diff" depends="init, techniques-merge" if="monolithic.diff">
<mkdir dir="${outputdir.techniques}"/>
<xslt in="sources/merged-techs.xml" out="${outputdir.techniques}/complete-diff.html" style="sources/diffspec-tech.xsl" force="true">
<factory name="${xslt.factory}"/>
<param name="show.diff.markup" expression="1"/>
<param name="show.issue.links" expression="1"/>
<param name="glthisversion" expression="${guidelines.uri}" if="guidelines.uri"/>
<param name="guidethisversion" expression="${understanding.uri}" if="understanding.uri"/>
<param name="techsthisversion" expression="."/>
</xslt>
</target>
<target name="techniques.slices" depends="init, techniques-merge">
<mkdir dir="${outputdir.techniques}"/>
<xslt in="sources/merged-techs.xml" out="temp.html" style="sources/slices-techniques-common.xsl" force="true">
<factory name="${xslt.factory}"/>
<param name="show.diff.markup" expression="0" if="slices.nodiff"/>
<param name="show.issue.links" expression="0" if="slices.nodiff"/>
<param name="show.diff.markup" expression="1" if="slices.diff"/>
<param name="show.issue.links" expression="1" if="slices.diff"/>
<param name="output.dir" expression="${outputdir.techniques}"/>
<param name="glthisversion" expression="${guidelines.uri}" if="guidelines.uri"/>
<param name="guidethisversion" expression="${understanding.uri}" if="understanding.uri"/>
<param name="techsthisversion" expression="."/>
</xslt>
<delete file="temp.html"/>
</target>
<target name="techniques.bytech" depends="init">
<mkdir dir="${outputdir.techniques}"/>
<xslt destdir="${outputdir.techniques}" style="sources/diffspec-tech.xsl" force="true">
<factory name="${xslt.factory}"/>
<param name="bytech" expression="1"/>
<param name="show.diff.markup" expression="0" if="slices.nodiff"/>
<param name="show.issue.links" expression="0" if="slices.nodiff"/>
<param name="show.diff.markup" expression="1" if="slices.diff"/>
<param name="show.issue.links" expression="1" if="slices.diff"/>
<param name="glthisversion" expression="${guidelines.uri}" if="guidelines.uri"/>
<param name="guidethisversion" expression="${understanding.uri}" if="understanding.uri"/>
<param name="techsthisversion" expression="."/>
<filelist dir="sources">
<file name="ARIA-tech-src.xml"/>
<file name="html-tech-src.xml"/>
<file name="css-tech.xml"/>
<file name="script-tech-src.xml"/>
<file name="server-tech-src.xml"/>
<file name="SMIL-tech-src.xml"/>
<file name="plain-text-tech-src.xml"/>
<file name="failure-tech-src.xml"/>
<file name="general-tech-src.xml"/>
</filelist>
<mapper>
<globmapper from="ARIA-tech-src.xml" to="aria.html"/>
<globmapper from="html-tech-src.xml" to="html.html"/>
<globmapper from="css-tech.xml" to="css.html"/>
<globmapper from="script-tech-src.xml" to="client-side-script.html"/>
<globmapper from="server-tech-src.xml" to="server-side-script.html"/>
<globmapper from="SMIL-tech-src.xml" to="smil.html"/>
<globmapper from="plain-text-tech-src.xml" to="text.html"/>
<globmapper from="failure-tech-src.xml" to="failures.html"/>
<globmapper from="general-tech-src.xml" to="general.html"/>
</mapper>
</xslt>
</target>
<target name="techniques" description="Generate Techniques" depends="init, techniques.single, techniques.single.diff, techniques.slices, techniques.bytech"/>
<!-- Quickref -->
<target name="quickref" depends="init" description="Generate Quickref">
<mkdir dir="${outputdir.quickref}"/>
<xslt in="sources/wcag2-quickref.xml" out="quickref-temp.php" style="sources/diffspec-quickref.xsl" force="true">
<factory name="${xslt.factory}"/>
<param name="show.diff.markup" expression="0" if="monolithic.nodiff"/>
<param name="show.diff.markup" expression="1" if="monolithic.diff"/>
</xslt>
<concat destfile="${outputdir.quickref}/Overview.php" force="true">
<filelist dir=".">
<file name="sources/quickref-leadin.php"/>
<file name="quickref-temp.php"/>
</filelist>
</concat>
<delete file="quickref-temp.php"/>
</target>
<!-- Everything -->
<!-- Only the guidelines target works.
<target name="all" depends="guidelines, understanding, techniques, quickref" description="Generate entire suite"/>
-->
<target name="all" depends="guidelines" description="Generate entire suite"/>
<!-- === Zip files of HTML versions === -->
<target name="guidelines.zip" depends="guidelines" description="Create zip and tgz files for the Guidelines">
<mkdir dir="${outputdir.zip.guidelines}"/>
<zip basedir="${outputdir.guidelines}" destfile="${outputdir.zip.guidelines}/wcag20-guidelines.zip">
<exclude name="CVS/"/>
</zip>
<tar basedir="${outputdir.guidelines}" destfile="${outputdir.zip.guidelines}/wcag20-guidelines.tar">
<exclude name="CVS/"/>
</tar>
<gzip src="${outputdir.zip.guidelines}/wcag20-guidelines.tar" destfile="${outputdir.zip.guidelines}/wcag20-guidelines.tgz"/>
<delete file="${outputdir.zip.guidelines}/wcag20-guidelines.tar"/>
</target>
<target name="understanding.zip" depends="understanding" description="Create zip and tgz files for Understanding">
<mkdir dir="${outputdir.zip.understanding}"/>
<zip basedir="${outputdir.understanding}" destfile="${outputdir.zip.understanding}/wcag20-understanding.zip">
<exclude name="CVS/"/>
</zip>
<tar basedir="${outputdir.understanding}" destfile="${outputdir.zip.understanding}/wcag20-understanding.tar">
<exclude name="CVS/"/>
</tar>
<gzip src="${outputdir.zip.understanding}/wcag20-understanding.tar" destfile="${outputdir.zip.understanding}/wcag20-understanding.tgz"/>
<delete file="${outputdir.zip.understanding}/wcag20-understanding.tar"/>
</target>
<target name="techniques.zip" depends="techniques" description="Create zip and tgz files for the Techniques">
<mkdir dir="${outputdir.zip.techniques}"/>
<zip basedir="${outputdir.techniques}" destfile="${outputdir.zip.techniques}/wcag20-techniques.zip">
<exclude name="CVS/"/>
</zip>
<tar basedir="${outputdir.techniques}" destfile="${outputdir.zip.techniques}/wcag20-techniques.tar">
<exclude name="CVS/"/>
</tar>
<gzip src="${outputdir.zip.techniques}/wcag20-techniques.tar" destfile="${outputdir.zip.techniques}/wcag20-techniques.tgz"/>
<delete file="${outputdir.zip.techniques}/wcag20-techniques.tar"/>
</target>
<target name="all.zip" depends="guidelines.zip, understanding.zip, techniques.zip" description="Generate zip and tgz files for the entire suite">
<!-- Generate guidelines, understanding, and techniques slightly differently for the monolithic zip -->
<antcall>
<target name="guidelines"/>
<target name="understanding"/>
<target name="techniques"/>
<!-- Override the cross reference URIs to be appropriate to the zip file. The parameters are passed along only if these properties are set from this task. -->
<param name="guidelines.uri" value="../guidelines/"/>
<param name="understanding.uri" value="../understanding/"/>
<param name="techniques.uri" value="../techniques/"/>
</antcall>
<mkdir dir="${outputdir.zip}"/>
<zip destfile="${outputdir.zip}/wcag20-all.zip">
<zipfileset dir="${outputdir.guidelines}" prefix="guidelines">
<exclude name="CVS/"/>
</zipfileset>
<zipfileset dir="${outputdir.understanding}" prefix="understanding">
<exclude name="CVS/"/>
</zipfileset>
<zipfileset dir="${outputdir.techniques}" prefix="techniques">
<exclude name="CVS/"/>
</zipfileset>
</zip>
<tar destfile="${outputdir.zip}/wcag20-all.tar">
<zipfileset dir="${outputdir.guidelines}" prefix="guidelines">
<exclude name="CVS/"/>
</zipfileset>
<zipfileset dir="${outputdir.understanding}" prefix="understanding">
<exclude name="CVS/"/>
</zipfileset>
<zipfileset dir="${outputdir.techniques}" prefix="techniques">
<exclude name="CVS/"/>
</zipfileset>
</tar>
<gzip src="${outputdir.zip}/wcag20-all.tar" destfile="${outputdir.zip}/wcag20-all.tgz"/>
<delete file="${outputdir.zip}/wcag20-all.tar"/>
<!-- Delete the generated HTML files because they're no good for checking into CVS, relative urls are specific to the zip file -->
<delete>
<fileset dir="${outputdir.guidelines}" includes="*.html"/>
<fileset dir="${outputdir.understanding}" includes="*.html"/>
<fileset dir="${outputdir.techniques}" includes="*.html"/>
</delete>
</target>
<!-- === XSL:FO versions === -->
<target name="guidelines.fo" depends="init"></target>
<target name="understanding.fo" depends="init"></target>
<target name="techniques.fo" depends="init"></target>
<target name="all.fo" depends="init, guidelines.fo, understanding.fo, techniques.fo"></target>
</project>