##// END OF EJS Templates
build.pl: remove prefix from from job name
Jani Honkonen -
r1133:d7b22fbc15ae
parent child
Show More
@@ -1,48 +1,55
1 use lib 'test/scripts'; # for IniFiles
1 use lib 'test/scripts'; # for IniFiles
2 use File::Basename;
2 use File::Basename;
3 use IniFiles;
3 use IniFiles;
4 use feature "switch";
4 use feature "switch";
5
5
6 # read command line params
6 # read command line params
7 my $jobname = shift;
7 my $jobname = shift;
8
8
9 # Strip the prefix from job name when using ${bamboo.buildPlanName}
10 my $prefix = "Digia Qt Commercial - Chart component - ";
11 $jobname =~ s/$prefix//;
12
9 # read ini file
13 # read ini file
10 my $scriptdir = File::Basename::dirname($0);
14 my $scriptdir = File::Basename::dirname($0);
11 my $inifile = $scriptdir . "/jobs.ini";
15 my $inifile = $scriptdir . "/jobs.ini";
12 my %cfg;
16 my %cfg;
13 tie %cfg, 'Config::IniFiles', ( -file => $inifile );
17 tie %cfg, 'Config::IniFiles', ( -file => $inifile );
14
18
15 # get section from ini by jobname
19 # get section from ini by jobname
16 my %build = %{$cfg{$jobname}};
20 my %build = %{$cfg{$jobname}};
21 if (!%build) {
22 die ("Unknown jobname! Check $inifile and bamboo job name.");
23 }
17
24
18 # print out the ini settings
25 # print out the ini settings
19 print "\n\n$jobname\n";
26 print "\n\n$jobname\n";
20 print "**********\n";
27 print "**********\n";
21 foreach (keys %build) {
28 foreach (keys %build) {
22 print $_ . " : " . $build{$_} . "\n";
29 print $_ . " : " . $build{$_} . "\n";
23 }
30 }
24
31
25 # examine the platform
32 # examine the platform
26 given ($build{'Platform'}) {
33 given ($build{'Platform'}) {
27 when ("Win7") {
34 when ("Win7") {
28 # construct a build command
35 # construct a build command
29 my @cmd;
36 my @cmd;
30 if ($build{'ToolChain'} eq "mingw") {
37 if ($build{'ToolChain'} eq "mingw") {
31 @cmd = ($scriptdir . "\\build_win_mingw.bat", $build{'QtDir'}, $build{'Config'}, $build{'MinGWDir'});
38 @cmd = ($scriptdir . "\\build_win_mingw.bat", $build{'QtDir'}, $build{'Config'}, $build{'MinGWDir'});
32 }
39 }
33 if ($build{'ToolChain'} eq "vs2005") {
40 if ($build{'ToolChain'} eq "vs2005") {
34 @cmd = ($scriptdir . "\\build_win_vs2005.bat", $build{'QtDir'}, $build{'Config'});
41 @cmd = ($scriptdir . "\\build_win_vs2005.bat", $build{'QtDir'}, $build{'Config'});
35 }
42 }
36 if ($build{'ToolChain'} eq "vs2008") {
43 if ($build{'ToolChain'} eq "vs2008") {
37 @cmd = ($scriptdir . "\\build_win_vs2008.bat", $build{'QtDir'}, $build{'Config'});
44 @cmd = ($scriptdir . "\\build_win_vs2008.bat", $build{'QtDir'}, $build{'Config'});
38 }
45 }
39 if ($build{'ToolChain'} eq "vs2010") {
46 if ($build{'ToolChain'} eq "vs2010") {
40 @cmd = ($scriptdir . "\\build_win_vs2010.bat", $build{'QtDir'}, $build{'Config'});
47 @cmd = ($scriptdir . "\\build_win_vs2010.bat", $build{'QtDir'}, $build{'Config'});
41 }
48 }
42 # run the build command
49 # run the build command
43 system (@cmd) == 0 or die "system @cmd failed: $?";
50 system (@cmd) == 0 or die "system @cmd failed: $?";
44 }
51 }
45 default {
52 default {
46 die "Unknown platform " . $build{'Platform'};
53 die "Unknown platform " . $build{'Platform'};
47 }
54 }
48 } No newline at end of file
55 }
General Comments 0
You need to be logged in to leave comments. Login now