This repository has been archived by the owner on Jun 30, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
/
build.xml
94 lines (77 loc) · 4.86 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
<?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="wcag21" basedir="." default="usage">
<description>Generate WCAG 2.1 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="outputdir" location="." description="Directory within which the output folders are created, normally "../YYYY" unless doing TR in which case it is "../../../TR/<YYYY>""/>
<property name="uri.prefix" value="file:///" description="Prefix if any that must be prepended to URIs to make it resolve on the platform"/>
<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="inputdir.guidelines" location="guidelines"/>
<property name="inputdir.understanding" location="understanding"/>
<property name="inputdir.techniques" location="techniques"/>
<property name="outputdir.guidelines" location="${outputdir}/guidelines"/>
<property name="outputdir.understanding" location="${outputdir}/understanding"/>
<property name="outputdir.techniques" location="${outputdir}/techniques"/>
<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"></target>
<target name="clean" description="Clean up any temp files">
<delete file="${inputdir.guidelines}/index-flat.html" failonerror="false"/>
<delete file="${inputdir.guidelines}/wcag21.xml" failonerror="false"/>
<delete file="${inputdir.techniques}/techniques.xml" failonerror="false"/>
<delete file="output.html" failonerror="false"/>
<delete dir="output" failonerror="false"/>
</target>
<target name="flatten" depends="init" description="Build a copy of guidelines with all data-include files incorporated">
<makeurl file="${basedir}/guidelines/" property="base.guidelines"/>
<xslt in="${inputdir.guidelines}/index.html" out="${inputdir.guidelines}/index-flat.html" style="xslt/flatten-document.xslt">
<factory name="${xslt.factory}"/>
<param name="base" expression="${base.guidelines}"/>
</xslt>
</target>
<target name="guidelines-xml" depends="flatten" description="Build an XML representation of the guidelines">
<xslt in="${inputdir.guidelines}/index-flat.html" out="${inputdir.guidelines}/wcag21.xml" style="xslt/generate-structure-xml.xslt">
<factory name="${xslt.factory}"/>
</xslt>
</target>
<!-- Techniques -->
<target name="techniques-xml" depends="flatten, guidelines-xml" description="Build an XML structure of all techniques">
<makeurl file="${basedir}/techniques" property="techniques.dir"/>
<makeurl file="${basedir}/understanding" property="understanding.dir"/>
<xslt in="${inputdir.guidelines}/wcag21.xml" out="${inputdir.techniques}/techniques.xml" style="xslt/generate-technique-xml.xslt">
<factory name="${xslt.factory}"/>
<param name="techniques.dir" expression="${techniques.dir}"/>
<param name="understanding.dir" expression="${understanding.dir}"/>
</xslt>
</target>
<!-- Understanding -->
<target name="understanding" depends="guidelines-xml" description="Generate formatted Understanding docs">
<makeurl file="${basedir}/understanding/" property="base.understanding"/>
<mkdir dir="${basedir}/output/"/>
<makeurl file="${basedir}/output/" property="output.dir"/>
<echo message="Outputting Understanding to ${output.dir}"/>
<xslt in="${inputdir.guidelines}/wcag21.xml" out="output.html" style="xslt/generate-understanding.xslt" force="true">
<factory name="${xslt.factory}"/>
<param name="base.dir" expression="${base.understanding}"/>
<param name="output.dir" expression="${output.dir}"/>
</xslt>
<copy file="understanding/understanding.css" todir="output/"/>
<copy todir="output/img/">
<fileset dir="understanding/21/img"/>
</copy>
</target>
<target name="understanding-toc" depends="guidelines-xml" description="Generate the TOC for Understanding">
<xslt in="${inputdir.guidelines}/wcag21.xml" out="understanding/toc.html" style="xslt/generate-understanding-toc.xslt" force="true">
<factory name="${xslt.factory}"/>
</xslt>
</target>
<!-- Everything -->
<target name="all" depends="init" description="Generate entire suite"/>
<!-- === Sanity check === -->
<target name="sanity" depends="init" description="Identifies inconsistencies in documents"></target>
</project>