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="delivery" default="build" xmlns:au="antlib:org.apache.ant.antunit" xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:ac="antlib:net.sf.antcontrib">
|
|
24 |
|
|
25 |
<property name="delivery.type" value="nokia" />
|
|
26 |
<target name="publish-releasable" if="publish.ci.dir" description="Publish the releasble package on a shared drived (must be built from a Mercurial clone)">
|
|
27 |
<ac:runtarget target="get-helium-revision" />
|
|
28 |
<mkdir dir="${publish.ci.dir}/${delivery.type}/${helium.revision}/" />
|
|
29 |
<copy file="${binary.delivery.zip}" todir="${publish.ci.dir}/${delivery.type}/${helium.revision}/" />
|
|
30 |
<echo file="${publish.ci.dir}/${delivery.type}/${helium.revision}/tickler.txt" message="done" />
|
|
31 |
</target>
|
|
32 |
|
|
33 |
<target name="cleanup-publish-dir" if="publish.ci.dir">
|
|
34 |
<tstamp>
|
628
|
35 |
<format property="before.date" pattern="MM/dd/yyyy hh:mm aa" offset="-5" unit="day"/>
|
587
|
36 |
</tstamp>
|
|
37 |
<echo>Deleting files before: ${before.date}</echo>
|
628
|
38 |
<ac:for param="file">
|
|
39 |
<fileset dir="${publish.ci.dir}" includes="**/*.zip">
|
587
|
40 |
<date datetime="${before.date}" when="before" />
|
|
41 |
</fileset>
|
628
|
42 |
<sequential>
|
|
43 |
<delete dir="@{file}/../" />
|
|
44 |
</sequential>
|
|
45 |
</ac:for>
|
|
46 |
<ac:for param="dir">
|
|
47 |
<dirset dir="${publish.ci.dir}" includes="*/*">
|
|
48 |
<date datetime="${before.date}" when="before" />
|
|
49 |
</dirset>
|
|
50 |
<sequential>
|
|
51 |
<ac:if>
|
|
52 |
<resourcecount when="equal" count="0">
|
|
53 |
<fileset dir="@{dir}" includes="*" />
|
|
54 |
</resourcecount>
|
|
55 |
<then>
|
|
56 |
<delete dir="@{dir}" />
|
|
57 |
</then>
|
|
58 |
</ac:if>
|
|
59 |
</sequential>
|
|
60 |
</ac:for>
|
587
|
61 |
</target>
|
|
62 |
|
|
63 |
<target name="create-sf-source-delivery" description="Create the SF source delivery">
|
|
64 |
<mkdir dir="${build.temp.dir}" />
|
|
65 |
<delete file="${sf.delivery.zip}" failonerror="false" />
|
|
66 |
<zip destfile="${sf.delivery.zip}">
|
|
67 |
<zipfileset dir="${source.root.dir}" prefix="helium">
|
|
68 |
<include name="**/*" />
|
|
69 |
<exclude name="build/**" />
|
|
70 |
<exclude name="**/distribution.policy.S60" />
|
|
71 |
<exclude name="builder/antlibs/cachedir/**" />
|
|
72 |
<exclude name="external/antlibs/**" />
|
|
73 |
<exclude name="external/antlibs2/**" />
|
|
74 |
<exclude name="external/python/configure_jython.*" />
|
|
75 |
<exclude name="external/python/lib/auto/**" />
|
628
|
76 |
<exclude name="external/cc-customizations/**" />
|
|
77 |
<exclude name="external/CruiseControl/**" />
|
587
|
78 |
<scriptselector language="jython">
|
|
79 |
try:
|
|
80 |
if file.isDirectory():
|
|
81 |
value = open(file.toString() + "/distribution.policy.S60").read().strip().strip('\n')
|
|
82 |
else:
|
|
83 |
value = open(file.getParent() + "/distribution.policy.S60").read().strip().strip('\n')
|
|
84 |
if value == '7':
|
|
85 |
#self.log("Selecting %s" % file)
|
|
86 |
self.setSelected(True)
|
|
87 |
else:
|
|
88 |
self.setSelected(False)
|
|
89 |
except:
|
|
90 |
print "distribution.policy.S60 is missing for %s" % file
|
|
91 |
self.setSelected(False)
|
|
92 |
</scriptselector>
|
|
93 |
</zipfileset>
|
|
94 |
</zip>
|
|
95 |
</target>
|
|
96 |
|
|
97 |
<target name="create-sf-delivery" depends="create-sf-source-delivery">
|
|
98 |
<delete dir="${build.temp.dir}/sf_helium" failonerror="false" />
|
|
99 |
<mkdir dir="${build.temp.dir}/sf_helium" />
|
|
100 |
<unzip src="${sf.delivery.zip}" dest="${build.temp.dir}/sf_helium" />
|
|
101 |
<exec osfamily="windows" executable="cmd" dir="${build.temp.dir}/sf_helium/helium/builder">
|
|
102 |
<arg value="/C" />
|
|
103 |
<arg value="bld.bat" />
|
|
104 |
<arg value="build" />
|
|
105 |
</exec>
|
|
106 |
<exec osfamily="windows" executable="cmd" dir="${build.temp.dir}/sf_helium/helium/builder">
|
|
107 |
<arg value="/C" />
|
|
108 |
<arg value="bld.bat" />
|
|
109 |
<arg value="-Dconfig=sf" />
|
|
110 |
<arg value="create-releasable" />
|
|
111 |
</exec>
|
|
112 |
</target>
|
|
113 |
|
|
114 |
<target name="get-latest-delivery">
|
|
115 |
<mkdir dir="${build.temp.dir}/temp" />
|
|
116 |
<basename file="${binary.delivery.zip}" property="binary.delivery.basename" />
|
|
117 |
<copy todir="${build.temp.dir}/temp" verbose="true">
|
588
|
118 |
<first>
|
|
119 |
<sort>
|
|
120 |
<reverse xmlns="antlib:org.apache.tools.ant.types.resources.comparators">
|
|
121 |
<date />
|
|
122 |
</reverse>
|
|
123 |
<fileset dir="${publish.ci.dir}/${delivery.type}">
|
|
124 |
<include name="*/${binary.delivery.basename}" />
|
|
125 |
<scriptselector language="jython">
|
587
|
126 |
<![CDATA[
|
|
127 |
try:
|
|
128 |
open(file.getParent() + "/tickler.txt").close()
|
588
|
129 |
self.setSelected(True)
|
587
|
130 |
except:
|
|
131 |
print "No ticker file for %s" % file
|
|
132 |
self.setSelected(False)
|
|
133 |
]]>
|
588
|
134 |
</scriptselector>
|
|
135 |
</fileset>
|
|
136 |
</sort>
|
|
137 |
</first>
|
587
|
138 |
<flattenmapper/>
|
|
139 |
</copy>
|
|
140 |
<unzip src="${build.temp.dir}/temp/${binary.delivery.basename}" dest="${build.temp.dir}/temp" />
|
|
141 |
</target>
|
588
|
142 |
|
|
143 |
<target name="get-latest-sf-delivery">
|
|
144 |
<antcall target="get-latest-delivery">
|
|
145 |
<param name="delivery.type" value="sf"/>
|
|
146 |
</antcall>
|
|
147 |
</target>
|
|
148 |
|
587
|
149 |
</project> |