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"/>
|
|
70 |
</target>
|
|
71 |
|
588
|
72 |
|
587
|
73 |
<target name="get-build-list">
|
|
74 |
<ivy:buildlist reference="ivy.buildlist.path">
|
|
75 |
<fileset refid="ant.build.files"/>
|
|
76 |
</ivy:buildlist>
|
|
77 |
</target>
|
|
78 |
|
588
|
79 |
|
587
|
80 |
<target name="report" depends="get-build-list" description="Create Ivy report for each component">
|
|
81 |
<subant target="report" buildpathref="ivy.buildlist.path">
|
|
82 |
<property name="builder.dir" location="${builder.dir}" />
|
|
83 |
</subant>
|
|
84 |
</target>
|
|
85 |
|
588
|
86 |
|
587
|
87 |
<target name="compile" depends="get-build-list">
|
|
88 |
<subant target="compile" buildpathref="ivy.buildlist.path">
|
|
89 |
<property name="builder.dir" location="${builder.dir}" />
|
|
90 |
<property name="source.root.dir" value="${source.root.dir}"/>
|
|
91 |
</subant>
|
|
92 |
</target>
|
|
93 |
|
588
|
94 |
|
587
|
95 |
<target name="build" depends="get-build-list" description="Build each component">
|
|
96 |
<subant target="package" buildpathref="ivy.buildlist.path">
|
|
97 |
<property name="builder.dir" location="${builder.dir}" />
|
|
98 |
<property name="source.root.dir" value="${source.root.dir}"/>
|
|
99 |
<property name="platform" value="${platform}"/>
|
|
100 |
</subant>
|
|
101 |
</target>
|
|
102 |
|
588
|
103 |
|
587
|
104 |
<target name="clean" depends="get-build-list" description="Run clean on each component">
|
|
105 |
<subant target="clean" buildpathref="ivy.buildlist.path">
|
|
106 |
<property name="builder.dir" location="${builder.dir}" />
|
|
107 |
<property name="source.root.dir" value="${source.root.dir}"/>
|
|
108 |
</subant>
|
|
109 |
</target>
|
|
110 |
|
588
|
111 |
|
587
|
112 |
<target name="test" depends="get-build-list,build" description="Run test on each component">
|
|
113 |
<ac:for param="file" keepgoing="true">
|
|
114 |
<path refid="ivy.buildlist.path" />
|
|
115 |
<sequential>
|
|
116 |
<echo>Testing: @{file}</echo>
|
|
117 |
<ant antfile="@{file}" dir="@{file}/.." target="test" inheritAll="false">
|
|
118 |
<property name="builder.dir" location="${builder.dir}" />
|
588
|
119 |
<property name="source.root.dir" location="${source.root.dir}" />
|
587
|
120 |
</ant>
|
|
121 |
</sequential>
|
|
122 |
</ac:for>
|
|
123 |
</target>
|
|
124 |
<!-- TODO: remove after CI tools are cleaned up -->
|
|
125 |
<target name="unittest" depends="test"/>
|
|
126 |
|
588
|
127 |
|
|
128 |
<target name="junit" depends="get-build-list" description="Run JUnit tests on each component">
|
587
|
129 |
<subant target="junit" buildpathref="ivy.buildlist.path">
|
|
130 |
<property name="builder.dir" location="${builder.dir}" />
|
588
|
131 |
<property name="source.root.dir" location="${source.root.dir}" />
|
587
|
132 |
</subant>
|
|
133 |
</target>
|
|
134 |
|
588
|
135 |
|
|
136 |
<target name="antunit" depends="get-build-list" description="Run AntUnit tests on each component">
|
587
|
137 |
<subant target="antunit" buildpathref="ivy.buildlist.path">
|
|
138 |
<property name="builder.dir" location="${builder.dir}" />
|
588
|
139 |
<property name="source.root.dir" location="${source.root.dir}" />
|
587
|
140 |
</subant>
|
|
141 |
</target>
|
|
142 |
|
588
|
143 |
|
587
|
144 |
<target name="quality" depends="get-build-list" description="Run quality checks on each component">
|
|
145 |
<ac:for param="file" keepgoing="true">
|
|
146 |
<path refid="ivy.buildlist.path" />
|
|
147 |
<sequential>
|
|
148 |
<echo>Checking @{file}</echo>
|
|
149 |
<ant antfile="@{file}" dir="@{file}/.." target="quality" inheritAll="false">
|
|
150 |
<property name="builder.dir" location="${builder.dir}" />
|
|
151 |
<property name="source.root.dir" value="${source.root.dir}"/>
|
|
152 |
<property name="platform" value="${platform}"/>
|
|
153 |
</ant>
|
|
154 |
</sequential>
|
|
155 |
</ac:for>
|
|
156 |
</target>
|
|
157 |
|
588
|
158 |
|
587
|
159 |
<target name="checkstyle" depends="get-build-list" description="Run checkstyle on each component">
|
|
160 |
<ac:for param="file" keepgoing="true">
|
|
161 |
<path refid="ivy.buildlist.path" />
|
|
162 |
<sequential>
|
|
163 |
<ant antfile="@{file}" dir="@{file}/.." target="checkstyle" inheritAll="false">
|
|
164 |
<property name="builder.dir" location="${builder.dir}" />
|
|
165 |
<property name="source.root.dir" value="${source.root.dir}"/>
|
|
166 |
<property name="platform" value="${platform}"/>
|
|
167 |
</ant>
|
|
168 |
</sequential>
|
|
169 |
</ac:for>
|
|
170 |
</target>
|
|
171 |
|
588
|
172 |
|
587
|
173 |
<target name="get-deps" description="Retrieving Helium dependencies">
|
|
174 |
<ac:if>
|
|
175 |
<not>
|
|
176 |
<isset property="config" />
|
|
177 |
</not>
|
|
178 |
<then>
|
|
179 |
<fail message="config is not defined." />
|
|
180 |
</then>
|
|
181 |
</ac:if>
|
|
182 |
<echo>Using ${config} configuration.</echo>
|
|
183 |
<delete>
|
|
184 |
<fileset dir="${build.temp.dir}" includes="ivy/com.nokia.helium.config/**" />
|
|
185 |
</delete>
|
|
186 |
<ivy:settings file="${source.root.dir}/${config}/settings/ivysettings.xml" />
|
|
187 |
|
|
188 |
<!-- the call to resolve is not mandatory, retrieve makes an implicit call if we don't -->
|
|
189 |
<ivy:resolve organisation="com.nokia.helium.config" module="helium-${config}-config" revision="1.0" inline="true" />
|
|
190 |
<ivy:retrieve sync="true" conf="default" organisation="com.nokia.helium.config"
|
|
191 |
module="helium-${config}-config" revision="1.0"
|
|
192 |
inline="true" type="jar"
|
|
193 |
pattern="${source.root.dir}/external/antlibs2/[artifact]-[revision].[ext]" />
|
|
194 |
<ivy:retrieve sync="true" conf="default" organisation="com.nokia.helium.config"
|
|
195 |
module="helium-${config}-config" revision="1.0"
|
|
196 |
inline="true" type="egg"
|
|
197 |
pattern="${source.root.dir}/external/python/lib/auto/[artifact]-[revision].[ext]" />
|
588
|
198 |
<fileset id="egg.deps.fileset" dir="${source.root.dir}/external/python/lib/auto" includes="*.egg" excludes="jython*.egg" />
|
587
|
199 |
<fmpp sourceFile="template/easy-install.pth.ftl" outputFile="${source.root.dir}/external/python/lib/auto/easy-install.pth">
|
|
200 |
<data>
|
|
201 |
project: antProject()
|
|
202 |
</data>
|
|
203 |
</fmpp>
|
|
204 |
|
|
205 |
<fileset id="egg.hlm.deps.fileset" dir="${source.root.dir}">
|
|
206 |
<include name="external/python/**/*.egg" />
|
|
207 |
<exclude name="**/2.5/**" />
|
|
208 |
</fileset>
|
|
209 |
<fmpp sourceFile="template/configure_jython.bat.ftl" outputFile="${source.root.dir}/external/python/configure_jython.bat">
|
|
210 |
<data>
|
|
211 |
project: antProject()
|
|
212 |
</data>
|
|
213 |
</fmpp>
|
|
214 |
|
|
215 |
<fmpp sourceFile="template/configure_jython.sh.ftl" outputFile="${source.root.dir}/external/python/configure_jython.sh">
|
|
216 |
<data>
|
|
217 |
project: antProject()
|
|
218 |
</data>
|
|
219 |
</fmpp>
|
|
220 |
</target>
|
|
221 |
|
|
222 |
|
|
223 |
<target name="build-helium-docs" unless="skip.docs">
|
|
224 |
<exec osfamily="windows" executable="${source.root.dir}/hlm.bat" dir="${source.root.dir}">
|
|
225 |
<arg value="docs"/>
|
|
226 |
</exec>
|
|
227 |
<exec osfamily="unix" executable="${source.root.dir}/hlm" dir="${source.root.dir}">
|
|
228 |
<arg value="docs"/>
|
|
229 |
</exec>
|
|
230 |
</target>
|
|
231 |
|
|
232 |
|
|
233 |
<target name="zip-releasable">
|
|
234 |
<delete file="${binary.delivery.zip}" failonerror="false" />
|
|
235 |
<zip destfile="${binary.delivery.zip}">
|
|
236 |
<zipfileset id="zip.content" dir="${source.root.dir}" prefix="helium">
|
|
237 |
<include name="hlm.bat" />
|
|
238 |
<include name="helium*.ant.xml" />
|
|
239 |
<include name="build.xml" />
|
|
240 |
<include name="tools/**" />
|
|
241 |
<include name="config/**" />
|
|
242 |
<include name="extensions/**" />
|
|
243 |
<include name="external/**" />
|
|
244 |
<include name="licenses/**" />
|
|
245 |
<include name="tests/minibuilds/**" />
|
|
246 |
<exclude name="config/version.txt.orig" />
|
|
247 |
<exclude name="**/distribution.policy.S60" />
|
|
248 |
</zipfileset>
|
|
249 |
<zipfileset id="zip.doc" dir="${source.root.dir}/build" prefix="helium">
|
|
250 |
<include name="doc/**" />
|
|
251 |
<exclude name="**/distribution.policy.S60" />
|
|
252 |
</zipfileset>
|
|
253 |
<zipfileset id="zip.executable" dir="${source.root.dir}" prefix="helium" filemode="755">
|
|
254 |
<include name="hlm" />
|
|
255 |
</zipfileset>
|
|
256 |
</zip>
|
|
257 |
</target>
|
|
258 |
|
|
259 |
|
|
260 |
<target name="get-helium-revision">
|
|
261 |
<exec executable="hg" outputproperty="hg.helium.revision">
|
|
262 |
<arg value="id" />
|
|
263 |
<arg value="--id" />
|
|
264 |
</exec>
|
|
265 |
<ac:propertyregex property="helium.revision"
|
|
266 |
input="${hg.helium.revision}"
|
|
267 |
regexp="([a-f0-9]+).*"
|
|
268 |
replace="\1"
|
|
269 |
casesensitive="false" />
|
|
270 |
<echo message="Revision set to: ${helium.revision}" />
|
|
271 |
</target>
|
|
272 |
|
588
|
273 |
|
587
|
274 |
<target name="update-version" depends="get-helium-revision">
|
|
275 |
<ac:if>
|
|
276 |
<available file="${source.root.dir}/config/version.txt.orig" />
|
|
277 |
<then>
|
|
278 |
<move file="${source.root.dir}/config/version.txt.orig" tofile="${source.root.dir}/config/version.txt" />
|
|
279 |
</then>
|
|
280 |
</ac:if>
|
|
281 |
<copy file="${source.root.dir}/config/version.txt" tofile="${source.root.dir}/config/version.txt.orig" />
|
|
282 |
<property file="${source.root.dir}/config/version.txt" />
|
|
283 |
<propertyfile file="${source.root.dir}/config/version.txt" comment="Helium version - DO NOT EDIT">
|
|
284 |
<entry key="helium.version" value="${helium.version}-r${helium.revision}"/>
|
|
285 |
</propertyfile>
|
|
286 |
</target>
|
|
287 |
|
588
|
288 |
|
587
|
289 |
<target name="restore-version">
|
|
290 |
<move file="${source.root.dir}/config/version.txt.orig" tofile="${source.root.dir}/config/version.txt" />
|
|
291 |
</target>
|
|
292 |
|
588
|
293 |
|
587
|
294 |
<target name="create-releasable" depends="get-deps,update-version,build-helium-docs,zip-releasable,restore-version" description="Create releasable binary package"/>
|
|
295 |
|
|
296 |
|
|
297 |
<target name="textdoc">
|
|
298 |
<delete dir="${build.temp.dir}/doc/doctmp" failonerror="false"/>
|
|
299 |
<copy todir="${build.temp.dir}/doc/doctmp" overwrite="true">
|
|
300 |
<fileset dir="${source.root.dir}/sf/doc/src"/>
|
|
301 |
</copy>
|
|
302 |
<copy todir="${build.temp.dir}/doc/doctmp" overwrite="true" flatten="true">
|
|
303 |
<fileset dir="${source.root.dir}" includes="*/java/*/**/*.rst"/>
|
|
304 |
<fileset dir="${source.root.dir}" includes="*/python/*/**/*.rst"/>
|
|
305 |
</copy>
|
|
306 |
<rstMacro version="1.0" src="${build.temp.dir}/doc/doctmp"/>
|
|
307 |
</target>
|
|
308 |
|
588
|
309 |
|
587
|
310 |
<!-- Macro to generate html docs from rst. -->
|
|
311 |
<macrodef name="rstMacro">
|
|
312 |
<attribute name="version"/>
|
|
313 |
<attribute name="src" default="${source.root.dir}/sf/doc/src"/>
|
|
314 |
<attribute name="output" default="${build.temp.dir}/doc/text"/>
|
|
315 |
<sequential>
|
|
316 |
<property name="sphinx.lib.dir" location="${builder.dir}/tools/sphinx/Sphinx-0.5.1-py2.5.egg/sphinx" />
|
|
317 |
<exec executable="python" failonerror="${failonerror}">
|
|
318 |
<env key="PYTHONPATH" path="${builder.dir}/tools/sphinx" />
|
|
319 |
<arg file="${builder.dir}/tools/sphinx/sphinx-build.py"/>
|
|
320 |
<arg value="-b" />
|
|
321 |
<arg value="html" />
|
|
322 |
<arg value="-D" />
|
|
323 |
<arg value="version=@{version}" />
|
|
324 |
<arg value="-D" />
|
|
325 |
<arg value="release=@{version}" />
|
|
326 |
<arg file="@{src}" />
|
|
327 |
<arg file="@{output}" />
|
|
328 |
</exec>
|
|
329 |
</sequential>
|
|
330 |
</macrodef>
|
588
|
331 |
|
587
|
332 |
</project>
|
588
|
333 |
|
|
334 |
|