1 # Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 # All rights reserved. |
|
3 # This component and the accompanying materials are made available |
|
4 # under the terms of "Eclipse Public License v1.0" |
|
5 # which accompanies this distribution, and is available |
|
6 # at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 # |
|
8 # Initial Contributors: |
|
9 # Nokia Corporation - initial contribution. |
|
10 # |
|
11 # Contributors: |
|
12 # |
|
13 # Description: |
|
14 # Script to launch MakeCBR.pl and test return code and zip up the CBR Environment on failure |
|
15 # |
|
16 # |
|
17 |
|
18 use strict; |
|
19 use Getopt::Long; |
|
20 |
|
21 my($build_id, $config_file, $log_file, $parallel, $release_ver, $debug_file, $help_flag, $prev_ver, $repair, $int_ver); |
|
22 |
|
23 GetOptions ( |
|
24 'b=s' => \$build_id, |
|
25 'c=s' => \$config_file, |
|
26 'l=s' => \$log_file, |
|
27 'v=s' => \$release_ver, |
|
28 'p=s' => \$prev_ver, |
|
29 'd=s' => \$debug_file, |
|
30 '+h' => \$help_flag, |
|
31 'repair' => \$repair, |
|
32 'i=s' => \$int_ver, |
|
33 'j=i' => \$parallel |
|
34 ); |
|
35 |
|
36 if(defined $ENV{PERL510_HOME}) |
|
37 { |
|
38 $ENV{PATH} = "$ENV{PERL510_HOME}\\bin;".$ENV{PATH}; |
|
39 system("path"); |
|
40 my $cmd_perl_version = `perl -v`; |
|
41 $cmd_perl_version =~ /(v\d+.\d+.\d+)/i; |
|
42 my $perl_version = $1; |
|
43 print "Add perl $perl_version executable path into env path\n"; |
|
44 } |
|
45 else |
|
46 { |
|
47 $parallel = 0; |
|
48 } |
|
49 |
|
50 |
|
51 # Build Command line |
|
52 # Must on correct drive |
|
53 my $commandline = "perl \\sf\\os\\buildtools\\toolsandutils\\productionbldtools\\makecbr\\makecbr.pl -b $build_id -v $release_ver -c $config_file"; |
|
54 |
|
55 if (defined $log_file) |
|
56 { |
|
57 $commandline .= " -l $log_file"; |
|
58 } |
|
59 |
|
60 if (defined $debug_file) |
|
61 { |
|
62 $commandline .= " -d $debug_file"; |
|
63 } |
|
64 |
|
65 if (defined $prev_ver) |
|
66 { |
|
67 $commandline .= " -p $prev_ver"; |
|
68 } |
|
69 |
|
70 if (defined $parallel) |
|
71 { |
|
72 $commandline .= " -j $parallel"; |
|
73 } |
|
74 print "makcbr command: $commandline\n"; |
|
75 system("$commandline"); |
|
76 |
|