587
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
|
2 |
<!--
|
|
3 |
============================================================================
|
|
4 |
Name : test.tabchar.ant.xml
|
|
5 |
Part of : Helium
|
|
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="Sample" xmlns:hlm="http://www.nokia.com/helium">
|
|
24 |
<description>
|
|
25 |
Testing for tab character
|
|
26 |
</description>
|
|
27 |
|
|
28 |
<taskdef resource="net/sf/antcontrib/antlib.xml"/>
|
588
|
29 |
|
|
30 |
|
|
31 |
<macrodef name="pow" uri="http://www.nokia.com/helium">
|
|
32 |
<sequential>
|
|
33 |
<echo>pow</echo>
|
|
34 |
</sequential>
|
|
35 |
</macrodef>
|
|
36 |
|
|
37 |
|
587
|
38 |
|
|
39 |
<property name="check-property-name" value="test"/>
|
|
40 |
<property name="helium.build.dir" value="output"/>
|
|
41 |
|
|
42 |
<presetdef name="check_PresetDef.Name" >
|
|
43 |
<echo>check PresetDef Name </echo>
|
|
44 |
</presetdef>
|
|
45 |
|
588
|
46 |
<macrodef name="duplicateMacro" uri="http://www.nokia.com/helium">
|
|
47 |
<attribute name="parameter" default="default"/>
|
|
48 |
<sequential>
|
|
49 |
<echo>@{parameter}</echo>
|
|
50 |
</sequential>
|
|
51 |
</macrodef>
|
|
52 |
|
587
|
53 |
<target name="hello">
|
|
54 |
<echo>Hello Checking Tab Character</echo>
|
|
55 |
</target>
|
|
56 |
|
|
57 |
<target name="smile" depends="hello">
|
|
58 |
<echo>Print Smile</echo>
|
|
59 |
</target>
|
|
60 |
|
|
61 |
<target name="Check_target.Name">
|
|
62 |
<echo>Checking target name</echo>
|
|
63 |
</target>
|
|
64 |
|
|
65 |
<target name="check-run-target">
|
|
66 |
<runtarget target="smile"/>
|
|
67 |
</target>
|
|
68 |
|
|
69 |
<target name="check-ant-call">
|
|
70 |
<antcall target="hello"/>
|
|
71 |
</target>
|
|
72 |
|
|
73 |
<target name="check-script-size">
|
|
74 |
<hlm:python>
|
|
75 |
print check-script-size
|
|
76 |
print check-script-size
|
|
77 |
print check-script-size
|
|
78 |
print check-script-size
|
|
79 |
print check-script-size
|
|
80 |
print check-script-size
|
|
81 |
print check-script-size
|
|
82 |
print check-script-size
|
|
83 |
print check-script-size
|
|
84 |
print check-script-size
|
|
85 |
print check-script-size
|
|
86 |
print check-script-size
|
|
87 |
print check-script-size
|
|
88 |
print check-script-size
|
|
89 |
print check-script-size
|
|
90 |
print check-script-size
|
|
91 |
print check-script-size
|
|
92 |
print check-script-size
|
|
93 |
print check-script-size
|
|
94 |
print check-script-size
|
|
95 |
print check-script-size
|
|
96 |
print check-script-size
|
|
97 |
print check-script-size
|
|
98 |
print check-script-size
|
|
99 |
print check-script-size
|
|
100 |
print check-script-size
|
|
101 |
print check-script-size
|
|
102 |
print check-script-size
|
|
103 |
print check-script-size
|
|
104 |
print check-script-size
|
|
105 |
print check-script-size
|
|
106 |
print check-script-size
|
|
107 |
print check-script-size
|
|
108 |
print check-script-size
|
|
109 |
print check-script-size
|
|
110 |
print check-script-size
|
|
111 |
print check-script-size
|
|
112 |
print check-script-size
|
|
113 |
print check-script-size
|
|
114 |
print check-script-size
|
|
115 |
print check-script-size
|
|
116 |
print check-script-size
|
|
117 |
print check-script-size
|
|
118 |
print check-script-size
|
|
119 |
print check-script-size
|
|
120 |
</hlm:python>
|
|
121 |
</target>
|
|
122 |
|
|
123 |
<target name="check-use-of-if-in-targets">
|
|
124 |
<if>
|
|
125 |
<isset property="build.drive"/>
|
|
126 |
<then>
|
|
127 |
<echo> Using build drive ${build.drive} </echo>
|
|
128 |
</then>
|
|
129 |
</if>
|
|
130 |
</target>
|
|
131 |
|
|
132 |
<target name="check-use-of-if-else-in-targets">
|
|
133 |
<if>
|
|
134 |
<and>
|
|
135 |
<isset property="major.version"/>
|
|
136 |
<isset property="minor.version"/>
|
|
137 |
</and>
|
|
138 |
<then>
|
|
139 |
<property name="core.build.version" value="1.0"/>
|
|
140 |
</then>
|
|
141 |
<else>
|
|
142 |
<property name="core.build.version" value="2.0"/>
|
|
143 |
</else>
|
|
144 |
</if>
|
|
145 |
</target>
|
|
146 |
|
|
147 |
<target name="check-use-of-if-then-in-targets">
|
|
148 |
<if>
|
|
149 |
<and>
|
|
150 |
<isset property="major.version"/>
|
|
151 |
<isset property="minor.version"/>
|
|
152 |
</and>
|
|
153 |
<then>
|
|
154 |
<property name="core.build.version" value="1.0"/>
|
|
155 |
</then>
|
|
156 |
</if>
|
|
157 |
</target>
|
|
158 |
|
|
159 |
<target name="check-prop-in-script">
|
|
160 |
<script language="jython" setbeans="false">
|
|
161 |
result = None
|
|
162 |
if project.getProperty("test.script.property")is not None:
|
|
163 |
result = "found"
|
|
164 |
</script>
|
|
165 |
</target>
|
|
166 |
|
|
167 |
<target name="check-prop-in-scriptcondition">
|
|
168 |
<attribute name="phase" default="compile"/>
|
|
169 |
<sequential>
|
|
170 |
<if>
|
|
171 |
<scriptcondition language="jython" value="false">
|
|
172 |
errorsTotal = project.getProperty("build.errors.total")
|
|
173 |
if int(r'@{error.limit}') > -1:
|
|
174 |
if int(errorsTotal) > int(r'@{error.limit}'):
|
|
175 |
self.setValue(1)
|
|
176 |
</scriptcondition>
|
|
177 |
<then>
|
|
178 |
<property name="compile.result" value="1"/>
|
|
179 |
</then>
|
|
180 |
<else>
|
|
181 |
<property name="compile.result" value="0"/>
|
|
182 |
</else>
|
|
183 |
</if>
|
|
184 |
</sequential>
|
|
185 |
</target>
|
|
186 |
|
|
187 |
<target name="check-prop-in-pythontask">
|
|
188 |
<hlm:python>
|
|
189 |
from path import path
|
|
190 |
print "Writing version file...."
|
|
191 |
vfile = path(r'${build.drive}'+"/").joinpath('s60_version.txt')
|
|
192 |
f = open(str(vfile), 'w')
|
|
193 |
f.write(path(r'${s60.getenv.path}').name)
|
|
194 |
f.close()
|
|
195 |
</hlm:python>
|
|
196 |
</target>
|
|
197 |
|
|
198 |
<property name="test.boolean1" value="true"/>
|
|
199 |
<property name="test.boolean2" value="yes"/>
|
|
200 |
<property name="test.boolean3" value="yes"/>
|
|
201 |
|
|
202 |
<target name="check-use-of-equals">
|
|
203 |
<if>
|
|
204 |
<and>
|
|
205 |
<equals arg1="test.boolean1" arg2="true"/>
|
|
206 |
<equals arg1="test.boolean2" arg2="yes"/>
|
|
207 |
<istrue value="test.boolean3"/>
|
|
208 |
</and>
|
|
209 |
<then>
|
|
210 |
<echo>Equals</echo>
|
|
211 |
</then>
|
|
212 |
</if>
|
|
213 |
</target>
|
|
214 |
|
|
215 |
<target name="check-jython-script">
|
|
216 |
<script language="jython">
|
|
217 |
if ${build.drive} is None:
|
|
218 |
print "Not found"
|
|
219 |
</script>
|
|
220 |
</target>
|
|
221 |
|
|
222 |
<target name="check-scriptcondition">
|
|
223 |
<attribute name="phase" default="compile"/>
|
|
224 |
<sequential>
|
|
225 |
<if>
|
|
226 |
<scriptcondition language="jython" value="false">
|
|
227 |
errorsTotal = ${build.errors.total}
|
|
228 |
if int(r'@{error.limit}') > -1:
|
|
229 |
if int(errorsTotal) > int(r'@{error.limit}'):
|
|
230 |
self.setValue(1)
|
|
231 |
</scriptcondition>
|
|
232 |
<then>
|
|
233 |
<property name="compile.result" value="1"/>
|
|
234 |
</then>
|
|
235 |
<else>
|
|
236 |
<property name="compile.result" value="0"/>
|
|
237 |
</else>
|
|
238 |
</if>
|
|
239 |
</sequential>
|
|
240 |
</target>
|
|
241 |
|
|
242 |
<target name="check-tabs">
|
|
243 |
<echo>checking tab characters</echo>
|
|
244 |
</target>
|
|
245 |
|
|
246 |
<target name="check-indentation">
|
|
247 |
<echo>checking indentation</echo>
|
|
248 |
</target>
|
588
|
249 |
|
628
|
250 |
<target name="check-empty-catch-finally-block-in-trycatch">
|
|
251 |
<echo>checking for empty catch block in try-catch</echo>
|
|
252 |
<trycatch property="test.try">
|
|
253 |
<try>
|
|
254 |
<condition/>
|
|
255 |
</try>
|
|
256 |
</trycatch>
|
|
257 |
</target>
|
|
258 |
|
|
259 |
<target name="check-empty-catch-block-in-trycatch">
|
|
260 |
<echo>checking for empty catch block in try-catch</echo>
|
|
261 |
<trycatch property="test.try">
|
|
262 |
<try>
|
|
263 |
<condition/>
|
|
264 |
</try>
|
|
265 |
<finally>
|
|
266 |
<echo> inside finally </echo>
|
|
267 |
</finally>
|
|
268 |
</trycatch>
|
|
269 |
</target>
|
|
270 |
|
|
271 |
<target name="check-empty-finally-block-in-trycatch">
|
|
272 |
<echo>checking for empty catch block in try-catch</echo>
|
|
273 |
<trycatch property="test.try">
|
|
274 |
<try>
|
|
275 |
<condition/>
|
|
276 |
</try>
|
|
277 |
<catch>
|
|
278 |
<echo> inside catch </echo>
|
|
279 |
</catch>
|
|
280 |
</trycatch>
|
|
281 |
</target>
|
|
282 |
|
|
283 |
<target name="check-multiple-catch-blocks-in-trycatch">
|
|
284 |
<echo>checking for empty catch block in try-catch</echo>
|
|
285 |
<trycatch property="test.try">
|
|
286 |
<try>
|
|
287 |
<condition/>
|
|
288 |
</try>
|
|
289 |
<catch>
|
|
290 |
<echo> inside catch1 </echo>
|
|
291 |
</catch>
|
|
292 |
<catch>
|
|
293 |
<echo> inside catch2 </echo>
|
|
294 |
</catch>
|
|
295 |
</trycatch>
|
|
296 |
</target>
|
588
|
297 |
|
587
|
298 |
</project> |