##// END OF EJS Templates
run_tests.pl: adding more comments
run_tests.pl: adding more comments

File last commit:

r1143:053a00f586e9
r1152:f8ae4740c650
Show More
build.pl
74 lines | 1.6 KiB | text/plain | PerlLexer
Jani Honkonen
First draft of new (universal) build script(s) for bamboo
r1132 use File::Basename;
use feature "switch";
Jani Honkonen
Add a script for running tests
r1134 use lib 'test/scripts';
use Jobs;
Jani Honkonen
First draft of new (universal) build script(s) for bamboo
r1132
# read command line params
my $jobname = shift;
Jani Honkonen
Add a script for running tests
r1134 # get script directory
my $scriptdir = File::Basename::dirname($0);
Jani Honkonen
build.pl: remove prefix from from job name
r1133
Jani Honkonen
First draft of new (universal) build script(s) for bamboo
r1132 # read ini file
my $inifile = $scriptdir . "/jobs.ini";
Jani Honkonen
Add a script for running tests
r1134 my %job = Jobs::get($inifile, $jobname);
Jani Honkonen
First draft of new (universal) build script(s) for bamboo
r1132
# examine the platform
Jani Honkonen
Add a script for running tests
r1134 given ($job{'Platform'}) {
Jani Honkonen
Adding mac support for Bamboo build script
r1140
Jani Honkonen
First draft of new (universal) build script(s) for bamboo
r1132 when ("Win7") {
Jani Honkonen
build.pl: path fix for windows builds
r1143
$scriptdir =~ s/\//\\/g; # replace / -> \
Jani Honkonen
Adding mac support for Bamboo build script
r1140
Jani Honkonen
First draft of new (universal) build script(s) for bamboo
r1132 # construct a build command
Jani Honkonen
Add a script for running tests
r1134 if ($job{'ToolChain'} eq "mingw") {
Jani Honkonen
Adding mac support for Bamboo build script
r1140 run($scriptdir . "\\build_win_mingw.bat", $job{'QtDir'}, $job{'Config'}, $job{'MinGWDir'});
Jani Honkonen
First draft of new (universal) build script(s) for bamboo
r1132 }
Jani Honkonen
Adding mac support for Bamboo build script
r1140 elsif ($job{'ToolChain'} eq "vs2005") {
run($scriptdir . "\\build_win_vs2005.bat", $job{'QtDir'}, $job{'Config'});
Jani Honkonen
First draft of new (universal) build script(s) for bamboo
r1132 }
Jani Honkonen
Adding mac support for Bamboo build script
r1140 elsif ($job{'ToolChain'} eq "vs2008") {
run($scriptdir . "\\build_win_vs2008.bat", $job{'QtDir'}, $job{'Config'});
Jani Honkonen
First draft of new (universal) build script(s) for bamboo
r1132 }
Jani Honkonen
Adding mac support for Bamboo build script
r1140 elsif ($job{'ToolChain'} eq "vs2010") {
run($scriptdir . "\\build_win_vs2010.bat", $job{'QtDir'}, $job{'Config'});
}
else {
die "Unknown toolchain!";
Jani Honkonen
First draft of new (universal) build script(s) for bamboo
r1132 }
}
Jani Honkonen
Adding mac support for Bamboo build script
r1140
when ("Mac") {
# setup build environment
$ENV{'QTDIR'} = $job{'QtDir'};
$ENV{'PATH'} = $job{'QtDir'} . "/bin:" . $ENV{'PATH'};
# run qmake
my $cmd;
if ($job{'ToolChain'} eq "clang") {
run("qmake -r -spec unsupported/macx-clang CONFIG+=" . $job{'Config'});
}
elsif ($job{'ToolChain'} eq "gcc") {
run("qmake -r CONFIG+=" . $job{'Config'});
}
else {
die "Unknown toolchain!";
}
# run make
run("make");
}
Jani Honkonen
First draft of new (universal) build script(s) for bamboo
r1132 default {
Jani Honkonen
Add a script for running tests
r1134 die "Unknown platform " . $job{'Platform'};
Jani Honkonen
First draft of new (universal) build script(s) for bamboo
r1132 }
Jani Honkonen
Adding mac support for Bamboo build script
r1140 }
sub run {
my $cmd;
foreach (@_) {
$cmd .= "$_ ";
}
print "running : $cmd\n";
system(@_) == 0 or die "system \"$cmd\" failed: $?";
Jani Honkonen
First draft of new (universal) build script(s) for bamboo
r1132 }