| 426 |
mpeltier |
1 |
<project default="publish" basedir=".">
|
| 166 |
mpeltier |
2 |
|
| 426 |
mpeltier |
3 |
<!-- customizable properties -->
|
|
|
4 |
<property file="build.properties" />
|
| 166 |
mpeltier |
5 |
|
| 426 |
mpeltier |
6 |
<!-- uncustomizable properties -->
|
|
|
7 |
<property name="common_web.archive" value="common_web.zip" />
|
| 430 |
mpeltier |
8 |
<property name="lib.dir" value="${basedir}/lib" />
|
| 426 |
mpeltier |
9 |
<property name="xml.dir" value="${basedir}/xml" />
|
|
|
10 |
<property name="html.src" value="${basedir}/html" />
|
|
|
11 |
<property name="cgi.src" value="${basedir}/cgi-bin" />
|
|
|
12 |
|
|
|
13 |
<property name="common.dir" value="${basedir}/common" />
|
|
|
14 |
<property name="dtd.dir" value="${common.dir}/dtd" />
|
|
|
15 |
|
|
|
16 |
<property name="stylesheets.dir" value="${common.dir}/stylesheets" />
|
|
|
17 |
<property name="stylesheet.browsable" value="${stylesheets.dir}/browsable.xsl" />
|
|
|
18 |
<property name="stylesheet.printable" value="${stylesheets.dir}/printable.xsl" />
|
|
|
19 |
|
|
|
20 |
<property name="last-modified.pattern" value="yyyy-MM-dd hh:mm aa" />
|
|
|
21 |
|
|
|
22 |
<!-- classpath -->
|
| 166 |
mpeltier |
23 |
<path id="externals.classpath">
|
| 430 |
mpeltier |
24 |
<fileset dir="${lib.dir}">
|
| 166 |
mpeltier |
25 |
<include name="**/*.jar"/>
|
|
|
26 |
</fileset>
|
|
|
27 |
</path>
|
|
|
28 |
|
|
|
29 |
<!-- ===================================================================== -->
|
| 426 |
mpeltier |
30 |
<!-- publish -->
|
|
|
31 |
<!-- ===================================================================== -->
|
|
|
32 |
<target name="publish"
|
| 2211 |
mpeltier |
33 |
depends="prepare, check, html_print, html"
|
|
|
34 |
description="Build the Web site">
|
| 426 |
mpeltier |
35 |
|
| 2211 |
mpeltier |
36 |
<touch file="${basedir}/.build"/>
|
|
|
37 |
</target>
|
|
|
38 |
|
| 426 |
mpeltier |
39 |
<!-- ===================================================================== -->
|
| 166 |
mpeltier |
40 |
<!-- prepare -->
|
|
|
41 |
<!-- ===================================================================== -->
|
| 426 |
mpeltier |
42 |
<target name="prepare"
|
| 2211 |
mpeltier |
43 |
depends="unzip_common_web"
|
|
|
44 |
description="Prepare the Web site build">
|
| 166 |
mpeltier |
45 |
|
| 2211 |
mpeltier |
46 |
<!-- rebuild HTML files only when needed -->
|
|
|
47 |
<uptodate property="rebuild.notNeeded" targetfile="${basedir}/.build">
|
|
|
48 |
<srcfiles dir="${dtd.dir}" includes="**/*.dtd"/>
|
|
|
49 |
<srcfiles dir="${stylesheets.dir}" includes="**/*.xsl"/>
|
|
|
50 |
<srcfiles dir="${xml.dir}" includes="**/*.xml"/>
|
|
|
51 |
</uptodate>
|
|
|
52 |
|
| 426 |
mpeltier |
53 |
<!-- mkdirs -->
|
|
|
54 |
<mkdir dir="${html.dest}"/>
|
|
|
55 |
<mkdir dir="${cgi.dest}"/>
|
|
|
56 |
|
|
|
57 |
<!-- set the time build -->
|
| 166 |
mpeltier |
58 |
<tstamp>
|
| 426 |
mpeltier |
59 |
<format property="last.modified" pattern="${last-modified.pattern}"/>
|
| 166 |
mpeltier |
60 |
</tstamp>
|
|
|
61 |
|
| 2211 |
mpeltier |
62 |
<!-- copy css stylesheet into ${html.dest} -->
|
|
|
63 |
<copy todir="${html.dest}">
|
|
|
64 |
<fileset dir="${stylesheets.dir}">
|
|
|
65 |
<include name="*.css"/>
|
|
|
66 |
</fileset>
|
|
|
67 |
</copy>
|
| 426 |
mpeltier |
68 |
|
| 2211 |
mpeltier |
69 |
<!-- copy common images into ${html.dest}/images -->
|
|
|
70 |
<copy todir="${html.dest}/images">
|
|
|
71 |
<fileset dir="${common.dir}/images" />
|
|
|
72 |
</copy>
|
|
|
73 |
|
| 426 |
mpeltier |
74 |
<!-- copy HTML files into ${html.dest} -->
|
|
|
75 |
<copy todir="${html.dest}">
|
|
|
76 |
<fileset dir="${html.src}" />
|
|
|
77 |
</copy>
|
| 166 |
mpeltier |
78 |
|
| 2904 |
mpeltier |
79 |
<!-- copy js into ${html.dest} -->
|
|
|
80 |
<copy todir="${html.dest}/js">
|
|
|
81 |
<fileset dir="${common.dir}/js" />
|
|
|
82 |
</copy>
|
|
|
83 |
|
| 426 |
mpeltier |
84 |
<!-- copy cgi-bin scripts into ${cgi.dest} -->
|
| 234 |
mpeltier |
85 |
<copy todir="${cgi.dest}">
|
| 426 |
mpeltier |
86 |
<fileset dir="${cgi.src}" />
|
| 166 |
mpeltier |
87 |
</copy>
|
|
|
88 |
<chmod dir="${cgi.dest}" perm="ugo+x" includes="*.*"/>
|
|
|
89 |
|
|
|
90 |
</target>
|
|
|
91 |
|
|
|
92 |
<!-- ===================================================================== -->
|
|
|
93 |
<!-- check -->
|
|
|
94 |
<!-- ===================================================================== -->
|
| 234 |
mpeltier |
95 |
<target name="check"
|
| 426 |
mpeltier |
96 |
depends="unzip_common_web"
|
|
|
97 |
description="Check the XML files syntax"
|
| 2211 |
mpeltier |
98 |
unless="rebuild.notNeeded">
|
| 166 |
mpeltier |
99 |
|
| 426 |
mpeltier |
100 |
<xmlvalidate failonerror="yes"
|
|
|
101 |
lenient="no"
|
|
|
102 |
warn="yes"
|
|
|
103 |
classname="org.apache.xerces.parsers.SAXParser">
|
|
|
104 |
<classpath refid="externals.classpath"/>
|
|
|
105 |
<fileset dir="${xml.dir}">
|
|
|
106 |
<include name="**/*.xml"/>
|
|
|
107 |
</fileset>
|
| 166 |
mpeltier |
108 |
</xmlvalidate>
|
|
|
109 |
|
|
|
110 |
</target>
|
|
|
111 |
|
|
|
112 |
<!-- ===================================================================== -->
|
| 426 |
mpeltier |
113 |
<!-- zip_common_web -->
|
| 166 |
mpeltier |
114 |
<!-- ===================================================================== -->
|
| 426 |
mpeltier |
115 |
<target name="zip_common_web"
|
|
|
116 |
description="Zip the ${common.dir} directory into ${common_web.archive}">
|
| 166 |
mpeltier |
117 |
|
| 426 |
mpeltier |
118 |
<zip zipfile="${common_web.archive}">
|
|
|
119 |
<zipfileset dir="${common.dir}" />
|
|
|
120 |
</zip>
|
| 166 |
mpeltier |
121 |
|
|
|
122 |
</target>
|
|
|
123 |
|
|
|
124 |
<!-- ===================================================================== -->
|
| 426 |
mpeltier |
125 |
<!-- unzip_common_web -->
|
|
|
126 |
<!-- ===================================================================== -->
|
|
|
127 |
<target name="unzip_common_web"
|
| 2211 |
mpeltier |
128 |
description="Unzip the ${common_web.archive} file into ${common.dir}">
|
| 426 |
mpeltier |
129 |
|
|
|
130 |
<unzip src="${common_web.archive}"
|
|
|
131 |
dest="${common.dir}"
|
|
|
132 |
overwrite="false"/>
|
|
|
133 |
|
|
|
134 |
</target>
|
|
|
135 |
|
|
|
136 |
<!-- ===================================================================== -->
|
| 166 |
mpeltier |
137 |
<!-- html_print -->
|
|
|
138 |
<!-- ===================================================================== -->
|
| 234 |
mpeltier |
139 |
<target name="html_print"
|
| 2211 |
mpeltier |
140 |
description="Build Web site (printable version)"
|
|
|
141 |
unless="rebuild.notNeeded">
|
| 166 |
mpeltier |
142 |
|
| 2211 |
mpeltier |
143 |
<!-- root Web site -->
|
| 426 |
mpeltier |
144 |
<antcall target="real_html">
|
|
|
145 |
<param name="srcdir" value="${xml.dir}/root" />
|
|
|
146 |
<param name="destdir" value="${html.dest}" />
|
|
|
147 |
<param name="project.file" value="project/project.xml" />
|
|
|
148 |
<param name="style" value="${stylesheet.printable}" />
|
|
|
149 |
<param name="extension" value="_print.html" />
|
|
|
150 |
</antcall>
|
|
|
151 |
|
|
|
152 |
</target>
|
|
|
153 |
|
|
|
154 |
<!-- ===================================================================== -->
|
|
|
155 |
<!-- html -->
|
|
|
156 |
<!-- ===================================================================== -->
|
|
|
157 |
<target name="html"
|
| 2211 |
mpeltier |
158 |
description="Build Web site (browsable version)"
|
|
|
159 |
unless="rebuild.notNeeded">
|
| 426 |
mpeltier |
160 |
|
| 2211 |
mpeltier |
161 |
<!-- root Web site -->
|
| 426 |
mpeltier |
162 |
<antcall target="real_html">
|
|
|
163 |
<param name="srcdir" value="${xml.dir}/root" />
|
|
|
164 |
<param name="destdir" value="${html.dest}" />
|
|
|
165 |
<param name="project.file" value="project/project.xml" />
|
|
|
166 |
<param name="style" value="${stylesheet.browsable}" />
|
|
|
167 |
<param name="extension" value=".html" />
|
|
|
168 |
</antcall>
|
|
|
169 |
|
|
|
170 |
</target>
|
|
|
171 |
|
|
|
172 |
<!-- ===================================================================== -->
|
|
|
173 |
<!-- real_html -->
|
|
|
174 |
<!-- ===================================================================== -->
|
|
|
175 |
<target name="real_html"
|
|
|
176 |
description="Do the real transformation xml -> html">
|
|
|
177 |
|
|
|
178 |
<style basedir="${srcdir}"
|
|
|
179 |
destdir="${destdir}"
|
|
|
180 |
style="${style}"
|
|
|
181 |
extension="${extension}"
|
| 2211 |
mpeltier |
182 |
processor="org.objectweb.util.ant.Xalan2Liaison"
|
|
|
183 |
force="true">
|
| 426 |
mpeltier |
184 |
|
|
|
185 |
<include name="**/*.xml"/>
|
|
|
186 |
<exclude name="${project.file}"/>
|
| 166 |
mpeltier |
187 |
|
| 426 |
mpeltier |
188 |
<classpath refid="externals.classpath"/>
|
| 238 |
mpeltier |
189 |
<param name="project-file" expression="${xml.dir}/${project.file}" />
|
| 426 |
mpeltier |
190 |
<param name="last-modified" expression="${last.modified}" />
|
| 166 |
mpeltier |
191 |
</style>
|
|
|
192 |
|
| 426 |
mpeltier |
193 |
</target>
|
| 166 |
mpeltier |
194 |
|
|
|
195 |
<!-- ===================================================================== -->
|
| 426 |
mpeltier |
196 |
<!-- clean -->
|
|
|
197 |
<!-- ===================================================================== -->
|
|
|
198 |
<target name="clean"
|
| 2211 |
mpeltier |
199 |
description="Delete the generated files">
|
| 426 |
mpeltier |
200 |
|
|
|
201 |
<delete includeEmptyDirs="true" quiet="true">
|
| 2211 |
mpeltier |
202 |
<fileset dir="${html.dest}"/>
|
| 166 |
mpeltier |
203 |
<fileset dir="${cgi.dest}"/>
|
| 426 |
mpeltier |
204 |
<fileset dir="${common.dir}"/>
|
| 166 |
mpeltier |
205 |
</delete>
|
|
|
206 |
|
| 2211 |
mpeltier |
207 |
<delete file="${basedir}/.build"/>
|
| 166 |
mpeltier |
208 |
</target>
|
|
|
209 |
|
|
|
210 |
</project>
|