author | Fionntina Carville <fionntinac@symbian.org> |
Mon, 15 Nov 2010 11:50:30 +0000 | |
branch | RCL_3 |
changeset 73 | f89a65650939 |
parent 70 | 375929f879c2 |
permissions | -rw-r--r-- |
57 | 1 |
# |
2 |
# Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
# All rights reserved. |
|
4 |
# This component and the accompanying materials are made available |
|
5 |
# under the terms of "Eclipse Public License v1.0" |
|
6 |
# which accompanies this distribution, and is available |
|
7 |
# at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
# |
|
9 |
# Initial Contributors: |
|
10 |
# Nokia Corporation - initial contribution. |
|
11 |
# |
|
12 |
# Contributors: |
|
13 |
# |
|
14 |
# Description: |
|
15 |
# |
|
16 |
||
17 |
||
18 |
use Cwd; # for cwd |
|
19 |
||
20 |
my $debug = 0; |
|
21 |
my $allowRun = 1; |
|
22 |
my $optionClean = 1; |
|
23 |
my $optionBuild = 1; |
|
24 |
my $optionFusion = 1; |
|
25 |
my $optionEngineTests = 1; |
|
26 |
my $optionUnitTests = 1; |
|
27 |
my $optionPlatform = ""; |
|
28 |
||
29 |
######################################## |
|
30 |
# BUILD LISTS |
|
31 |
# |
|
32 |
||
33 |
my @fusionComponents = ( |
|
34 |
"videoutils\\group", |
|
35 |
"videoplayer\\group" |
|
36 |
); |
|
37 |
||
38 |
my @engineTests = ( |
|
39 |
"videoutils\\tsrc\\group", |
|
40 |
"videoplayer\\tsrc\\group" |
|
41 |
); |
|
42 |
||
43 |
my @unitTests = ( |
|
44 |
"videoplayer\\videoplayback\\videohelix\\tsrc\\ut_videohelixtest\\group", |
|
45 |
"videoplayer\\videoplayback\\videoplaybackcontrols\\tsrc\\videoplaybackcontrols_test\\group", |
|
46 |
"videoplayer\\videoplayback\\videoplaybackviews\\tsrc\\ut_userinputhandlertest\\group", |
|
47 |
"videoplayer\\videoplayerapp\\mpxvideoplayer\\tsrc\\ut_mpxvideoplayertest\\group", |
|
70
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
48 |
"videoplayer\\videocollection\\hgmyvideos\\tsrc\\ut_vcxhgmyvideosmainview\\group", |
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
49 |
"videoplayer\\videocollection\\mpxmyvideoscollection\\tsrc\\ut_collectionplugintest\\group", |
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
50 |
"videoplayer\\videocollection\\mpxmyvideoscollection\\tsrc\\ut_vcxmyvideoscollectionutiltest\\group", |
375929f879c2
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
51 |
"videoplayer\\videocollection\\mpxmyvideoscollection\\tsrc\\ut_vcxmyvideosmdsdb\\group" |
57 | 52 |
); |
53 |
||
54 |
######################################## |
|
55 |
# PARSE ARGUMENTS |
|
56 |
# |
|
57 |
||
58 |
while(scalar(@ARGV) >= 1) |
|
59 |
{ |
|
60 |
my $argument = shift(@ARGV); |
|
61 |
||
62 |
if($argument eq "-nobuild") |
|
63 |
{ |
|
64 |
$optionBuild = 0; |
|
65 |
} |
|
66 |
||
67 |
elsif($argument eq "-noclean") |
|
68 |
{ |
|
69 |
$optionClean = 0; |
|
70 |
} |
|
71 |
||
72 |
elsif($argument eq "-nounit") |
|
73 |
{ |
|
74 |
$optionUnitTests = 0; |
|
75 |
} |
|
76 |
||
77 |
elsif($argument eq "-noengine") |
|
78 |
{ |
|
79 |
$optionEngineTests = 0; |
|
80 |
} |
|
81 |
||
82 |
elsif($argument eq "-nofusion") |
|
83 |
{ |
|
84 |
$optionFusion = 0; |
|
85 |
} |
|
86 |
||
87 |
elsif($argument eq "-platform") |
|
88 |
{ |
|
89 |
$optionPlatform = shift(@ARGV); |
|
90 |
} |
|
91 |
||
92 |
elsif($argument eq "-debug") |
|
93 |
{ |
|
94 |
$debug = 1; |
|
95 |
} |
|
96 |
||
97 |
elsif($argument eq "-norun") |
|
98 |
{ |
|
99 |
$allowRun = 0; |
|
100 |
} |
|
101 |
||
102 |
elsif($argument eq "-help") |
|
103 |
{ |
|
104 |
ShowHelp(); |
|
105 |
} |
|
106 |
||
107 |
else |
|
108 |
{ |
|
109 |
ShowHelp(); |
|
110 |
} |
|
111 |
} |
|
112 |
||
113 |
######################################## |
|
114 |
# MAIN FUNCTION |
|
115 |
# |
|
116 |
||
117 |
my $basepath = FindBasePath(); |
|
118 |
exit("NO VIDEOAPP_DOMAIN FOLDER FOUND") if $basepath eq ""; |
|
119 |
||
120 |
if ( $optionClean ) |
|
121 |
{ |
|
122 |
if ( $optionFusion ) |
|
123 |
{ |
|
124 |
foreach my $component ( @fusionComponents ) |
|
125 |
{ |
|
126 |
Clean( $basepath, $component, $optionPlatform, 0 ); |
|
127 |
} |
|
128 |
} |
|
129 |
||
130 |
if ( $optionEngineTests ) |
|
131 |
{ |
|
132 |
foreach my $component ( @engineTests ) |
|
133 |
{ |
|
134 |
Clean( $basepath, $component, $optionPlatform, 1 ); |
|
135 |
} |
|
136 |
} |
|
137 |
||
138 |
if ( $optionUnitTests ) |
|
139 |
{ |
|
140 |
# Clean all unit tests |
|
141 |
foreach my $component ( @unitTests ) |
|
142 |
{ |
|
143 |
Clean( $basepath, $component, $optionPlatform, 1 ); |
|
144 |
} |
|
145 |
} |
|
146 |
} |
|
147 |
||
148 |
if ( $optionBuild ) |
|
149 |
{ |
|
150 |
if ( $optionFusion ) |
|
151 |
{ |
|
152 |
foreach my $component ( @fusionComponents ) |
|
153 |
{ |
|
154 |
Build( $basepath, $component, $optionPlatform, 0 ); |
|
155 |
} |
|
156 |
} |
|
157 |
||
158 |
if ( $optionEngineTests ) |
|
159 |
{ |
|
160 |
# Clean all engine tests |
|
161 |
foreach my $component ( @engineTests ) |
|
162 |
{ |
|
163 |
Build( $basepath, $component, $optionPlatform, 1 ); |
|
164 |
} |
|
165 |
} |
|
166 |
||
167 |
if ( $optionUnitTests ) |
|
168 |
{ |
|
169 |
# Clean all unit tests |
|
170 |
foreach my $component ( @unitTests ) |
|
171 |
{ |
|
172 |
Build( $basepath, $component, $optionPlatform, 1 ); |
|
173 |
} |
|
174 |
} |
|
175 |
} |
|
176 |
||
177 |
######################################## |
|
178 |
# FindBasePath |
|
179 |
# |
|
180 |
||
181 |
sub FindBasePath |
|
182 |
{ |
|
183 |
print ">> FindBasePath\n" if $debug; |
|
184 |
$currpath = cwd; |
|
185 |
$basepath = ""; |
|
186 |
my $domain = "VideoApp_Domain"; |
|
187 |
||
188 |
my $pos = rindex( $currpath, $domain ); |
|
189 |
||
190 |
if( $pos != -1 ) |
|
191 |
{ |
|
192 |
$basepath = "\\" . substr( $currpath, 3, $pos + length( $domain ) - 3 ); |
|
193 |
$basepath =~ s/\//\\/g; |
|
194 |
print "BASEPATH FOUND: $basepath\n" if $debug; |
|
195 |
} |
|
196 |
||
197 |
print "<< FindBasePath (" . $basepath . ")\n" if $debug; |
|
198 |
return $basepath; |
|
199 |
} |
|
200 |
||
201 |
######################################## |
|
202 |
# Clean |
|
203 |
# |
|
204 |
||
205 |
sub Clean |
|
206 |
{ |
|
207 |
my ( $baseDir, $destDir, $optionPlatform, $isTestComponent ) = @_; |
|
208 |
print ">>> CLEAN ${baseDir}\\${destDir}\\bld.inf FOR $optionPlatform\n" if $debug; |
|
209 |
print "##\n#\n# CLEANING ${baseDir}\\${destDir}\n#\n##\n"; |
|
210 |
||
211 |
my $cmd = ""; |
|
212 |
||
213 |
if( $isTestComponent ) |
|
214 |
{ |
|
215 |
if( $optionPlatform eq "" ) # platform not given, clean armv5.test and winscw.test |
|
216 |
{ |
|
217 |
$cmd = "sbs reallyclean -b ${baseDir}\\${destDir}\\bld.inf -c winscw.test"; |
|
218 |
print $cmd . "\n" if $debug; |
|
219 |
system($cmd) if $allowRun; |
|
220 |
$cmd = "sbs reallyclean -b ${baseDir}\\${destDir}\\bld.inf -c armv5.test"; |
|
221 |
print $cmd . "\n" if $debug; |
|
222 |
system($cmd) if $allowRun; |
|
223 |
} |
|
224 |
else # platform is given, run clean only for that |
|
225 |
{ |
|
226 |
$cmd .= "sbs reallyclean -b ${baseDir}\\${destDir}\\bld.inf -c ${optionPlatform}\.test"; |
|
227 |
print $cmd . "\n" if $debug; |
|
228 |
system($cmd) if $allowRun; |
|
229 |
} |
|
230 |
} |
|
231 |
else # is not testcomponent |
|
232 |
{ |
|
233 |
$cmd .= "sbs reallyclean -b ${baseDir}\\${destDir}\\bld.inf"; |
|
234 |
$cmd .= " -c $optionPlatform" if $optionPlatform ne ""; |
|
235 |
print $cmd . "\n" if $debug; |
|
236 |
system($cmd) if $allowRun; |
|
237 |
} |
|
238 |
print "<<< CLEAN\n" if $debug; |
|
239 |
} |
|
240 |
||
241 |
######################################## |
|
242 |
# Build |
|
243 |
# |
|
244 |
||
245 |
sub Build |
|
246 |
{ |
|
247 |
my ( $baseDir, $destDir, $optionPlatform, $isTestComponent ) = @_; |
|
248 |
print ">>> BUILD ${baseDir}\\${destDir}\\bld.inf FOR $optionPlatform\n" if $debug; |
|
249 |
print "##\n#\n# BUILDING ${baseDir}\\${destDir}\n#\n##\n"; |
|
250 |
#my $cmd = "sbs -b ${baseDir}\\${destDir}\\bld.inf"; |
|
251 |
#$cmd .= " -c $optionPlatform" if $optionPlatform ne ""; |
|
252 |
#$cmd .= ".test" if $isTestComponent; |
|
253 |
#print $cmd . "\n" if $debug; |
|
254 |
#system($cmd) if $allowRun; |
|
255 |
||
256 |
my $cmd = ""; |
|
257 |
||
258 |
if( $isTestComponent ) |
|
259 |
{ |
|
260 |
if( $optionPlatform eq "" ) # platform not given, clean armv5.test and winscw.test |
|
261 |
{ |
|
262 |
$cmd = "sbs -b ${baseDir}\\${destDir}\\bld.inf -c winscw.test"; |
|
263 |
print $cmd . "\n" if $debug; |
|
264 |
system($cmd) if $allowRun; |
|
265 |
$cmd = "sbs -b ${baseDir}\\${destDir}\\bld.inf -c armv5.test"; |
|
266 |
print $cmd . "\n" if $debug; |
|
267 |
system($cmd) if $allowRun; |
|
268 |
} |
|
269 |
else # platform is given, run clean only for that |
|
270 |
{ |
|
271 |
$cmd .= "sbs -b ${baseDir}\\${destDir}\\bld.inf -c ${optionPlatform}\.test"; |
|
272 |
print $cmd . "\n" if $debug; |
|
273 |
system($cmd) if $allowRun; |
|
274 |
} |
|
275 |
} |
|
276 |
else # is not testcomponent |
|
277 |
{ |
|
278 |
$cmd .= "sbs -b ${baseDir}\\${destDir}\\bld.inf"; |
|
279 |
$cmd .= " -c $optionPlatform" if $optionPlatform ne ""; |
|
280 |
print $cmd . "\n" if $debug; |
|
281 |
system($cmd) if $allowRun; |
|
282 |
} |
|
283 |
||
284 |
print "<<< BUILD\n" if $debug; |
|
285 |
} |
|
286 |
||
287 |
#------------------------------------------------------------------------------------ |
|
288 |
# ShowHelp |
|
289 |
#------------------------------------------------------------------------------------ |
|
290 |
sub ShowHelp { |
|
291 |
||
292 |
print <<USAGE_EOF; |
|
293 |
builder.pl |
|
294 |
||
295 |
This script will search the VideoApp_Domain root folder from current path. |
|
296 |
if the root folder is not found, the script will exit. In any other case, |
|
297 |
it builds all components. |
|
298 |
||
299 |
Options: |
|
300 |
||
301 |
-platform wanted platform |
|
302 |
-noclean no clean. |
|
303 |
-nobuild no build. |
|
304 |
-nofusion exclude fusion components. |
|
305 |
-noengine exclude engine tests. |
|
306 |
-nounit exclude unit tests. |
|
307 |
-debug show debug message |
|
308 |
-norun do not run, for debugging purposes |
|
309 |
-help You're reading it. |
|
310 |
||
311 |
Examples: |
|
312 |
||
313 |
builder.pl -nobuild -platform armv5_udeb |
|
314 |
This will clean all the armv5_udeb components without building them. |
|
315 |
||
316 |
builder.pl -noclean -nofusion -noengine -platform armv5_udeb |
|
317 |
This will build only unit tests without cleaning them first. |
|
318 |
||
319 |
USAGE_EOF |
|
320 |
||
321 |
exit(); |
|
322 |
||
323 |
}; |