587
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
|
2 |
<!--
|
|
3 |
============================================================================
|
|
4 |
Name : build.xml
|
|
5 |
Part of : Helium AntLib
|
|
6 |
|
|
7 |
Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
8 |
All rights reserved.
|
|
9 |
This component and the accompanying materials are made available
|
|
10 |
under the terms of the License "Eclipse Public License v1.0"
|
|
11 |
which accompanies this distribution, and is available
|
|
12 |
at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
13 |
|
|
14 |
Initial Contributors:
|
|
15 |
Nokia Corporation - initial contribution.
|
|
16 |
|
|
17 |
Contributors:
|
|
18 |
|
|
19 |
Description:
|
|
20 |
|
|
21 |
============================================================================
|
|
22 |
-->
|
|
23 |
<project name="helium-builder" default="build" xmlns:au="antlib:org.apache.ant.antunit" xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:ac="antlib:net.sf.antcontrib">
|
|
24 |
<property environment="env" />
|
|
25 |
<taskdef name="fmpp" classname="fmpp.tools.AntTask" />
|
|
26 |
<import file="delivery.ant.xml" />
|
|
27 |
|
588
|
28 |
<!-- Ensuring that only Ant 1.7.0 is in use.
|
587
|
29 |
<ac:if>
|
|
30 |
<not>
|
|
31 |
<contains string="${ant.version}" substring="1.7.0" />
|
|
32 |
</not>
|
|
33 |
<then>
|
|
34 |
<fail message="Your current ant version is ${ant.version}, you must use 1.7.0" />
|
|
35 |
</then>
|
588
|
36 |
</ac:if> -->
|
587
|
37 |
|
|
38 |
<condition property="platform" value="win32" else="unix">
|
|
39 |
<os family="windows"/>
|
|
40 |
</condition>
|
588
|
41 |
|
587
|
42 |
<dirname property="builder.dir" file="${ant.file.helium-builder}" />
|
|
43 |
<property name="source.root.dir" location="${builder.dir}/.." />
|
|
44 |
<property name="build.temp.dir" location="${source.root.dir}/build" />
|
|
45 |
<property name="components.temp.dir" location="${build.temp.dir}/components" />
|
|
46 |
<property name="component" value="*" />
|
|
47 |
<property name="component.type" value="*" />
|
|
48 |
<property name="component.root" value="*" />
|
|
49 |
<property name="config" value="sf" />
|
|
50 |
<property name="sf.delivery.zip" location="${build.temp.dir}/helium-sf-src.zip" />
|
|
51 |
<property name="binary.delivery.zip" location="${build.temp.dir}/helium-bin.zip" />
|
|
52 |
|
|
53 |
<fileset id="ant.build.files" dir="${source.root.dir}">
|
|
54 |
<include name="${component.root}/${component.type}/${component}/build.xml" />
|
|
55 |
<exclude name="*builder/**" />
|
|
56 |
<exclude name="*/*builder/**" />
|
|
57 |
<exclude name="tools/**" />
|
|
58 |
<exclude name="config/**" />
|
|
59 |
<exclude name="doc/**" />
|
|
60 |
<exclude name="external/**" />
|
|
61 |
<exclude name="extensions/**" />
|
|
62 |
<exclude name="licences/**" />
|
|
63 |
<exclude name="tests/**" />
|
|
64 |
<exclude name="build/**" />
|
|
65 |
</fileset>
|
|
66 |
|
588
|
67 |
|
587
|
68 |
<target name="cleanup" description="Cleanup (delete the temp build directory)">
|
|
69 |
<delete dir="${build.temp.dir}" failonerror="false"/>
|
628
|
70 |
<delete dir="${source.root.dir}/external/antlibs2" failonerror="false" />
|
|
71 |
<delete dir="${source.root.dir}/external/python/lib/auto" failonerror="false" />
|
587
|
72 |
</target>
|
|
73 |
|
588
|
74 |
|
587
|
75 |
<target name="get-build-list">
|
|
76 |
<ivy:buildlist reference="ivy.buildlist.path">
|
|
77 |
<fileset refid="ant.build.files"/>
|
|
78 |
</ivy:buildlist>
|
|
79 |
</target>
|
|
80 |
|
588
|
81 |
|
587
|
82 |
<target name="report" depends="get-build-list" description="Create Ivy report for each component">
|
|
83 |
<subant target="report" buildpathref="ivy.buildlist.path">
|
|
84 |
<property name="builder.dir" location="${builder.dir}" />
|
|
85 |
</subant>
|
|
86 |
</target>
|
|
87 |
|
588
|
88 |
|
587
|
89 |
<target name="compile" depends="get-build-list">
|
|
90 |
<subant target="compile" buildpathref="ivy.buildlist.path">
|
|
91 |
<property name="builder.dir" location="${builder.dir}" />
|
|
92 |
<property name="source.root.dir" value="${source.root.dir}"/>
|
|
93 |
</subant>
|
|
94 |
</target>
|
|
95 |
|
588
|
96 |
|
587
|
97 |
<target name="build" depends="get-build-list" description="Build each component">
|
|
98 |
<subant target="package" buildpathref="ivy.buildlist.path">
|
|
99 |
<property name="builder.dir" location="${builder.dir}" />
|
|
100 |
<property name="source.root.dir" value="${source.root.dir}"/>
|
|
101 |
<property name="platform" value="${platform}"/>
|
|
102 |
</subant>
|
|
103 |
</target>
|
|
104 |
|
588
|
105 |
|
587
|
106 |
<target name="clean" depends="get-build-list" description="Run clean on each component">
|
|
107 |
<subant target="clean" buildpathref="ivy.buildlist.path">
|
|
108 |
<property name="builder.dir" location="${builder.dir}" />
|
|
109 |
<property name="source.root.dir" value="${source.root.dir}"/>
|
|
110 |
</subant>
|
|
111 |
</target>
|
|
112 |
|
588
|
113 |
|
587
|
114 |
<target name="test" depends="get-build-list,build" description="Run test on each component">
|
|
115 |
<ac:for param="file" keepgoing="true">
|
|
116 |
<path refid="ivy.buildlist.path" />
|
|
117 |
<sequential>
|
628
|
118 |
<ac:trycatch>
|
|
119 |
<try>
|
|
120 |
<echo>Start component test set: @{file}</echo>
|
|
121 |
<ant antfile="@{file}" dir="@{file}/.." target="test" inheritAll="false">
|
|
122 |
<property name="builder.dir" location="${builder.dir}" />
|
|
123 |
<property name="source.root.dir" location="${source.root.dir}" />
|
|
124 |
</ant>
|
|
125 |
<echo>End component test set: @{file}</echo>
|
|
126 |
</try>
|
|
127 |
<catch>
|
|
128 |
<property name="quality.thrown" value="@{file}"/>
|
|
129 |
</catch>
|
|
130 |
</ac:trycatch>
|
587
|
131 |
</sequential>
|
|
132 |
</ac:for>
|
628
|
133 |
<ac:if>
|
|
134 |
<isset property="quality.thrown"/>
|
|
135 |
<then>
|
|
136 |
<fail message="${quality.thrown} failed"/>
|
|
137 |
</then>
|
|
138 |
</ac:if>
|
587
|
139 |
</target>
|
|
140 |
<!-- TODO: remove after CI tools are cleaned up -->
|
|
141 |
<target name="unittest" depends="test"/>
|
|
142 |
|
588
|
143 |
|
|
144 |
<target name="junit" depends="get-build-list" description="Run JUnit tests on each component">
|
587
|
145 |
<subant target="junit" buildpathref="ivy.buildlist.path">
|
|
146 |
<property name="builder.dir" location="${builder.dir}" />
|
588
|
147 |
<property name="source.root.dir" location="${source.root.dir}" />
|
587
|
148 |
</subant>
|
|
149 |
</target>
|
|
150 |
|
588
|
151 |
|
|
152 |
<target name="antunit" depends="get-build-list" description="Run AntUnit tests on each component">
|
587
|
153 |
<subant target="antunit" buildpathref="ivy.buildlist.path">
|
|
154 |
<property name="builder.dir" location="${builder.dir}" />
|
588
|
155 |
<property name="source.root.dir" location="${source.root.dir}" />
|
587
|
156 |
</subant>
|
|
157 |
</target>
|
|
158 |
|
588
|
159 |
|
587
|
160 |
<target name="quality" depends="get-build-list" description="Run quality checks on each component">
|
|
161 |
<ac:for param="file" keepgoing="true">
|
|
162 |
<path refid="ivy.buildlist.path" />
|
|
163 |
<sequential>
|
|
164 |
<echo>Checking @{file}</echo>
|
628
|
165 |
<ac:trycatch>
|
|
166 |
<try>
|
|
167 |
<ant antfile="@{file}" dir="@{file}/.." target="quality" inheritAll="false">
|
|
168 |
<property name="builder.dir" location="${builder.dir}" />
|
|
169 |
<property name="source.root.dir" value="${source.root.dir}"/>
|
|
170 |
<property name="platform" value="${platform}"/>
|
|
171 |
</ant>
|
|
172 |
</try>
|
|
173 |
<catch>
|
|
174 |
<property name="quality.thrown" value="@{file}"/>
|
|
175 |
</catch>
|
|
176 |
</ac:trycatch>
|
587
|
177 |
</sequential>
|
|
178 |
</ac:for>
|
628
|
179 |
<ac:if>
|
|
180 |
<isset property="quality.thrown"/>
|
|
181 |
<then>
|
|
182 |
<fail message="${quality.thrown} failed"/>
|
|
183 |
</then>
|
|
184 |
</ac:if>
|
587
|
185 |
</target>
|
|
186 |
|
588
|
187 |
|
628
|
188 |
<target name="ci" depends="quality"/>
|
|
189 |
|
587
|
190 |
<target name="checkstyle" depends="get-build-list" description="Run checkstyle on each component">
|
|
191 |
<ac:for param="file" keepgoing="true">
|
|
192 |
<path refid="ivy.buildlist.path" />
|
|
193 |
<sequential>
|
628
|
194 |
<ac:trycatch>
|
|
195 |
<try>
|
|
196 |
<ant antfile="@{file}" dir="@{file}/.." target="checkstyle" inheritAll="false">
|
|
197 |
<property name="builder.dir" location="${builder.dir}" />
|
|
198 |
<property name="source.root.dir" value="${source.root.dir}"/>
|
|
199 |
<property name="platform" value="${platform}"/>
|
|
200 |
</ant>
|
|
201 |
</try>
|
|
202 |
<catch>
|
|
203 |
<property name="quality.thrown" value="@{file}"/>
|
|
204 |
</catch>
|
|
205 |
</ac:trycatch>
|
587
|
206 |
</sequential>
|
|
207 |
</ac:for>
|
628
|
208 |
<ac:if>
|
|
209 |
<isset property="quality.thrown"/>
|
|
210 |
<then>
|
|
211 |
<fail message="${quality.thrown} failed"/>
|
|
212 |
</then>
|
|
213 |
</ac:if>
|
587
|
214 |
</target>
|
|
215 |
|
588
|
216 |
|
587
|
217 |
<target name="get-deps" description="Retrieving Helium dependencies">
|
|
218 |
<ac:if>
|
|
219 |
<not>
|
|
220 |
<isset property="config" />
|
|
221 |
</not>
|
|
222 |
<then>
|
|
223 |
<fail message="config is not defined." />
|
|
224 |
</then>
|
|
225 |
</ac:if>
|
|
226 |
<echo>Using ${config} configuration.</echo>
|
|
227 |
<delete>
|
|
228 |
<fileset dir="${build.temp.dir}" includes="ivy/com.nokia.helium.config/**" />
|
|
229 |
</delete>
|
|
230 |
<ivy:settings file="${source.root.dir}/${config}/settings/ivysettings.xml" />
|
|
231 |
|
|
232 |
<!-- the call to resolve is not mandatory, retrieve makes an implicit call if we don't -->
|
|
233 |
<ivy:resolve organisation="com.nokia.helium.config" module="helium-${config}-config" revision="1.0" inline="true" />
|
|
234 |
<ivy:retrieve sync="true" conf="default" organisation="com.nokia.helium.config"
|
|
235 |
module="helium-${config}-config" revision="1.0"
|
|
236 |
inline="true" type="jar"
|
628
|
237 |
pattern="${source.root.dir}/external/antlibs2/[artifact]-[revision].[ext]" />
|
|
238 |
<delete>
|
|
239 |
<fileset dir="${source.root.dir}" includes="external/python/lib/auto/zipnotsafe/**" />
|
|
240 |
</delete>
|
587
|
241 |
<ivy:retrieve sync="true" conf="default" organisation="com.nokia.helium.config"
|
|
242 |
module="helium-${config}-config" revision="1.0"
|
|
243 |
inline="true" type="egg"
|
628
|
244 |
pattern="${source.root.dir}/external/python/lib/auto/zipsafe/[artifact]-[revision].[ext]" />
|
|
245 |
<ivy:retrieve sync="false" conf="default" organisation="com.nokia.helium.config"
|
|
246 |
module="helium-${config}-config" revision="1.0"
|
|
247 |
inline="true" type="py"
|
|
248 |
pattern="${source.root.dir}/external/python/lib/auto/[artifact].[ext]" />
|
|
249 |
|
|
250 |
|
|
251 |
<path id="egg.deps.fileset" >
|
|
252 |
<dirset dir="${source.root.dir}/external/python/lib/auto" includes="*/*.egg" excludes="*/jython*.egg" />
|
|
253 |
<fileset dir="${source.root.dir}/external/python/lib/auto" includes="*/*.egg" excludes="*/jython*.egg" />
|
|
254 |
</path>
|
587
|
255 |
<fmpp sourceFile="template/easy-install.pth.ftl" outputFile="${source.root.dir}/external/python/lib/auto/easy-install.pth">
|
|
256 |
<data>
|
|
257 |
project: antProject()
|
628
|
258 |
ant: antProperties()
|
587
|
259 |
</data>
|
|
260 |
</fmpp>
|
|
261 |
|
628
|
262 |
<path id="egg.hlm.deps.fileset">
|
|
263 |
<dirset dir="${source.root.dir}">
|
|
264 |
<include name="external/python/lib/**/*.egg" />
|
|
265 |
<exclude name="**/*amara*" />
|
|
266 |
<exclude name="**/2.5/**" />
|
|
267 |
</dirset>
|
|
268 |
<fileset dir="${source.root.dir}">
|
|
269 |
<include name="external/python/**/*.egg" />
|
|
270 |
<exclude name="**/*amara*" />
|
|
271 |
<exclude name="**/2.5/**" />
|
|
272 |
</fileset>
|
|
273 |
</path>
|
587
|
274 |
<fmpp sourceFile="template/configure_jython.bat.ftl" outputFile="${source.root.dir}/external/python/configure_jython.bat">
|
|
275 |
<data>
|
|
276 |
project: antProject()
|
628
|
277 |
ant: antProperties()
|
587
|
278 |
</data>
|
|
279 |
</fmpp>
|
|
280 |
|
|
281 |
<fmpp sourceFile="template/configure_jython.sh.ftl" outputFile="${source.root.dir}/external/python/configure_jython.sh">
|
|
282 |
<data>
|
|
283 |
project: antProject()
|
628
|
284 |
ant: antProperties()
|
587
|
285 |
</data>
|
|
286 |
</fmpp>
|
|
287 |
</target>
|
|
288 |
|
|
289 |
|
|
290 |
<target name="build-helium-docs" unless="skip.docs">
|
|
291 |
<exec osfamily="windows" executable="${source.root.dir}/hlm.bat" dir="${source.root.dir}">
|
|
292 |
<arg value="docs"/>
|
|
293 |
</exec>
|
|
294 |
<exec osfamily="unix" executable="${source.root.dir}/hlm" dir="${source.root.dir}">
|
|
295 |
<arg value="docs"/>
|
|
296 |
</exec>
|
|
297 |
</target>
|
|
298 |
|
|
299 |
|
|
300 |
<target name="zip-releasable">
|
|
301 |
<delete file="${binary.delivery.zip}" failonerror="false" />
|
|
302 |
<zip destfile="${binary.delivery.zip}">
|
|
303 |
<zipfileset id="zip.content" dir="${source.root.dir}" prefix="helium">
|
|
304 |
<include name="hlm.bat" />
|
|
305 |
<include name="helium*.ant.xml" />
|
|
306 |
<include name="build.xml" />
|
|
307 |
<include name="tools/**" />
|
|
308 |
<include name="config/**" />
|
|
309 |
<include name="extensions/**" />
|
|
310 |
<include name="external/**" />
|
|
311 |
<include name="licenses/**" />
|
|
312 |
<include name="tests/minibuilds/**" />
|
|
313 |
<exclude name="config/version.txt.orig" />
|
|
314 |
<exclude name="**/distribution.policy.S60" />
|
|
315 |
</zipfileset>
|
|
316 |
<zipfileset id="zip.doc" dir="${source.root.dir}/build" prefix="helium">
|
|
317 |
<include name="doc/**" />
|
|
318 |
<exclude name="**/distribution.policy.S60" />
|
|
319 |
</zipfileset>
|
|
320 |
<zipfileset id="zip.executable" dir="${source.root.dir}" prefix="helium" filemode="755">
|
|
321 |
<include name="hlm" />
|
|
322 |
</zipfileset>
|
|
323 |
</zip>
|
|
324 |
</target>
|
|
325 |
|
|
326 |
|
|
327 |
<target name="get-helium-revision">
|
|
328 |
<exec executable="hg" outputproperty="hg.helium.revision">
|
|
329 |
<arg value="id" />
|
|
330 |
<arg value="--id" />
|
|
331 |
</exec>
|
|
332 |
<ac:propertyregex property="helium.revision"
|
|
333 |
input="${hg.helium.revision}"
|
|
334 |
regexp="([a-f0-9]+).*"
|
|
335 |
replace="\1"
|
|
336 |
casesensitive="false" />
|
|
337 |
<echo message="Revision set to: ${helium.revision}" />
|
|
338 |
</target>
|
|
339 |
|
588
|
340 |
|
587
|
341 |
<target name="update-version" depends="get-helium-revision">
|
|
342 |
<ac:if>
|
|
343 |
<available file="${source.root.dir}/config/version.txt.orig" />
|
|
344 |
<then>
|
|
345 |
<move file="${source.root.dir}/config/version.txt.orig" tofile="${source.root.dir}/config/version.txt" />
|
|
346 |
</then>
|
|
347 |
</ac:if>
|
|
348 |
<copy file="${source.root.dir}/config/version.txt" tofile="${source.root.dir}/config/version.txt.orig" />
|
|
349 |
<property file="${source.root.dir}/config/version.txt" />
|
|
350 |
<propertyfile file="${source.root.dir}/config/version.txt" comment="Helium version - DO NOT EDIT">
|
|
351 |
<entry key="helium.version" value="${helium.version}-r${helium.revision}"/>
|
|
352 |
</propertyfile>
|
|
353 |
</target>
|
|
354 |
|
588
|
355 |
|
587
|
356 |
<target name="restore-version">
|
|
357 |
<move file="${source.root.dir}/config/version.txt.orig" tofile="${source.root.dir}/config/version.txt" />
|
|
358 |
</target>
|
|
359 |
|
588
|
360 |
|
587
|
361 |
<target name="create-releasable" depends="get-deps,update-version,build-helium-docs,zip-releasable,restore-version" description="Create releasable binary package"/>
|
|
362 |
|
|
363 |
|
|
364 |
<target name="textdoc">
|
|
365 |
<delete dir="${build.temp.dir}/doc/doctmp" failonerror="false"/>
|
|
366 |
<copy todir="${build.temp.dir}/doc/doctmp" overwrite="true">
|
|
367 |
<fileset dir="${source.root.dir}/sf/doc/src"/>
|
|
368 |
</copy>
|
|
369 |
<copy todir="${build.temp.dir}/doc/doctmp" overwrite="true" flatten="true">
|
628
|
370 |
<fileset dir="${source.root.dir}" includes="*/java/*/**/*.rst" excludes="*/java/*/doc/**/*.rst" />
|
|
371 |
<fileset dir="${source.root.dir}" includes="*/python/*/**/*.rst" excludes="*/python/*/doc/**/*.rst" />
|
|
372 |
<fileset dir="${source.root.dir}" includes="*/java/*/doc/" />
|
|
373 |
<fileset dir="${source.root.dir}" includes="*/python/*/doc/" />
|
587
|
374 |
</copy>
|
|
375 |
<rstMacro version="1.0" src="${build.temp.dir}/doc/doctmp"/>
|
|
376 |
</target>
|
|
377 |
|
588
|
378 |
|
587
|
379 |
<!-- Macro to generate html docs from rst. -->
|
|
380 |
<macrodef name="rstMacro">
|
|
381 |
<attribute name="version"/>
|
|
382 |
<attribute name="src" default="${source.root.dir}/sf/doc/src"/>
|
|
383 |
<attribute name="output" default="${build.temp.dir}/doc/text"/>
|
|
384 |
<sequential>
|
|
385 |
<property name="sphinx.lib.dir" location="${builder.dir}/tools/sphinx/Sphinx-0.5.1-py2.5.egg/sphinx" />
|
|
386 |
<exec executable="python" failonerror="${failonerror}">
|
|
387 |
<env key="PYTHONPATH" path="${builder.dir}/tools/sphinx" />
|
|
388 |
<arg file="${builder.dir}/tools/sphinx/sphinx-build.py"/>
|
|
389 |
<arg value="-b" />
|
|
390 |
<arg value="html" />
|
|
391 |
<arg value="-D" />
|
|
392 |
<arg value="version=@{version}" />
|
|
393 |
<arg value="-D" />
|
|
394 |
<arg value="release=@{version}" />
|
|
395 |
<arg file="@{src}" />
|
|
396 |
<arg file="@{output}" />
|
|
397 |
</exec>
|
|
398 |
</sequential>
|
|
399 |
</macrodef>
|
588
|
400 |
|
587
|
401 |
</project>
|
588
|
402 |
|
|
403 |
|