tools/buildbot/bootstrap.pl
author David Anderson <dvander@alliedmods.net>
Sat Sep 06 09:12:21 2008 +0000 (2008-09-06)
changeset 2256 de422b59bdfc
parent 2255 fbd5031ee601
child 2263 423bdb06c27e
permissions -rwxr-xr-x
Bootstrap performs all steps up to executing builer now.
Builder sends error code on failure now.
     1 #!/usr/bin/perl
     2 
     3 use strict;
     4 use Cwd;
     5 use File::Basename;
     6 
     7 my ($myself, $path) = fileparse($0);
     8 chdir($path);
     9 
    10 require 'helpers.pm';
    11 
    12 chdir(Build::PathFormat('../builder'));
    13 if ($^O eq "linux")
    14 {
    15     Build::Command('make clean');
    16     Build::Command('make');
    17 }
    18 else
    19 {
    20     Build::Command($ENV{'MSVC7'} . ' /Rebuild Release builder.csproj');
    21     Build::Command('move ' . Build::PathFormat('bin/Release/builder.exe') . ' .');
    22 }
    23 
    24 die "Unable to build builder tool!\n" unless -e 'builder.exe';
    25 
    26 #Go back to main source dir.
    27 chdir(Build::PathFormat('../..'));
    28 
    29 #Get the source path.
    30 my ($root) = getcwd();
    31 
    32 #Create output folder if it doesn't exist.
    33 if (!(-d 'OUTPUT')) {
    34     mkdir('OUTPUT') or die("Failed to create output folder: $!\n");
    35 }
    36 
    37 #Write the configuration file.
    38 open(CONF, '>build.cfg') or die("Failed to write build.cfg: $!\n");
    39 print CONF "OutputBase = " . Build::PathFormat($root . '/OUTPUT') . "\n";
    40 print CONF "SourceBase = $root\n";
    41 if ($^O eq "linux") 
    42 {
    43     print CONF "BuilderPath = /usr/bin/make\n";
    44 }
    45 else
    46 {
    47     print CONF "BuilderPath = " . $ENV{'MSVC8'} . "\n";
    48 }
    49 close(CONF);
    50 
    51 #Do the annoying revision bumping.
    52 #Linux needs some help here.
    53 if ($^O eq "linux")
    54 {
    55     Build::Command("flip -u modules.versions");
    56     Build::Command("flip -u tools/versionchanger.pl");
    57     Build::Command("chmod +x tools/versionchanger.pl");
    58 }
    59 Build::Command("tools/versionchanger.pl");