-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.xml
More file actions
196 lines (156 loc) · 6.46 KB
/
Copy pathbuild.xml
File metadata and controls
196 lines (156 loc) · 6.46 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
<project default="publish" basedir=".">
<!-- customizable properties -->
<property file="build.properties" />
<!-- uncustomizable properties -->
<property name="lib.dir" value="${basedir}/lib" />
<property name="xml.dir" value="${basedir}/xml" />
<property name="html.src" value="${basedir}/html" />
<property name="common.dir" value="${basedir}/common" />
<property name="dtd.dir" value="${common.dir}/dtd" />
<property name="stylesheets.dir" value="${common.dir}/stylesheets" />
<property name="stylesheet.browsable"
value="${stylesheets.dir}/browsable.xsl" />
<property name="stylesheet.printable"
value="${stylesheets.dir}/printable.xsl" />
<property name="last-modified.pattern" value="yyyy-MM-dd hh:mm aa" />
<!-- classpath -->
<path id="classpath">
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
</fileset>
</path>
<!-- ===================================================================== -->
<!-- publish -->
<!-- ===================================================================== -->
<target name="publish"
depends="prepare-default, check, html_print, html"
description="Build the Web site">
<touch file="${basedir}/.build" />
</target>
<!-- ===================================================================== -->
<!-- publish -->
<!-- ===================================================================== -->
<target name="publish-test"
depends="prepare-test, check, html_print, html"
description="Build a local Web site (for testing only)">
<touch file="${basedir}/.build" />
</target>
<!-- ===================================================================== -->
<!-- prepare -->
<!-- ===================================================================== -->
<target name="prepare-default" depends="prepare-common">
<property name="html.dest" value="${default.html.dest}"/>
<antcall target="copy-resources"/>
</target>
<target name="prepare-test" depends="prepare-common">
<property name="html.dest" value="${test.html.dest}"/>
<antcall target="copy-resources"/>
</target>
<target name="prepare-common">
<!-- rebuild HTML files only when needed -->
<uptodate property="rebuild.notNeeded" targetfile="${basedir}/.build">
<srcfiles dir="${dtd.dir}" includes="**/*.dtd" />
<srcfiles dir="${stylesheets.dir}" includes="**/*.xsl" />
<srcfiles dir="${xml.dir}" includes="**/*.xml" />
</uptodate>
<!-- set the time build -->
<tstamp>
<format property="last.modified" pattern="${last-modified.pattern}" />
</tstamp>
</target>
<target name="copy-resources" description="Prepare the Web site build">
<!-- mkdirs -->
<mkdir dir="${html.dest}" />
<!-- copy css stylesheet into ${html.dest} -->
<copy todir="${html.dest}">
<fileset dir="${stylesheets.dir}">
<include name="*.css" />
</fileset>
</copy>
<!-- copy common images into ${html.dest}/images -->
<copy todir="${html.dest}/images">
<fileset dir="${common.dir}/images" />
</copy>
<!-- copy js into ${html.dest} -->
<copy todir="${html.dest}/js">
<fileset dir="${common.dir}/js" />
</copy>
<!-- copy HTML files into ${html.dest} -->
<copy todir="${html.dest}">
<fileset dir="${html.src}" />
</copy>
</target>
<!-- ===================================================================== -->
<!-- check -->
<!-- ===================================================================== -->
<target name="check"
description="Check the XML files syntax"
unless="rebuild.notNeeded">
<xmlvalidate failonerror="yes"
lenient="no"
warn="yes"
classname="org.apache.xerces.parsers.SAXParser">
<classpath refid="classpath" />
<fileset dir="${xml.dir}">
<include name="**/*.xml" />
</fileset>
</xmlvalidate>
</target>
<!-- ===================================================================== -->
<!-- html_print -->
<!-- ===================================================================== -->
<target name="html_print"
description="Build Web site (printable version)"
unless="rebuild.notNeeded">
<!-- root Web site -->
<antcall target="real_html">
<param name="srcdir" value="${xml.dir}/root" />
<param name="destdir" value="${html.dest}" />
<param name="project.file" value="project/project.xml" />
<param name="style" value="${stylesheet.printable}" />
<param name="extension" value="_print.html" />
</antcall>
</target>
<!-- ===================================================================== -->
<!-- html -->
<!-- ===================================================================== -->
<target name="html"
description="Build Web site (browsable version)"
unless="rebuild.notNeeded">
<!-- root Web site -->
<antcall target="real_html">
<param name="srcdir" value="${xml.dir}/root" />
<param name="destdir" value="${html.dest}" />
<param name="project.file" value="project/project.xml" />
<param name="style" value="${stylesheet.browsable}" />
<param name="extension" value=".html" />
</antcall>
</target>
<!-- ===================================================================== -->
<!-- real_html -->
<!-- ===================================================================== -->
<target name="real_html" description="Do the real transformation xml -> html">
<xslt basedir="${srcdir}"
destdir="${destdir}"
style="${style}"
extension="${extension}"
processor="org.objectweb.util.ant.Xalan2Liaison"
force="true">
<include name="**/*.xml" />
<exclude name="${project.file}" />
<classpath refid="classpath" />
<param name="project-file" expression="${xml.dir}/${project.file}" />
<param name="last-modified" expression="${last.modified}" />
</xslt>
</target>
<!-- ===================================================================== -->
<!-- clean -->
<!-- ===================================================================== -->
<target name="clean" description="Delete the generated files">
<delete includeEmptyDirs="true" quiet="true">
<fileset dir="${default.html.dest}" />
<fileset dir="${test.html.dest}" />
</delete>
<delete file="${basedir}/.build" />
</target>
</project>