2010-04-04 23:07:37 +00:00
|
|
|
#!/usr/bin/perl
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use Cwd;
|
|
|
|
use File::Basename;
|
|
|
|
|
|
|
|
my ($myself, $path) = fileparse($0);
|
|
|
|
chdir($path);
|
|
|
|
|
|
|
|
require 'helpers.pm';
|
|
|
|
|
|
|
|
#Go to main source dir
|
|
|
|
chdir(Build::PathFormat('../..'));
|
|
|
|
|
|
|
|
#Do the annoying revision bumping.
|
|
|
|
#Linux needs some help here.
|
2013-02-13 07:22:40 +00:00
|
|
|
if ($^O eq "linux" || $^O eq "darwin")
|
2010-04-04 23:07:37 +00:00
|
|
|
{
|
|
|
|
Build::Command("flip -u modules.versions");
|
|
|
|
Build::Command("flip -u support/versionchanger.pl");
|
|
|
|
Build::Command("chmod +x support/versionchanger.pl");
|
|
|
|
}
|
2013-02-15 07:30:38 +00:00
|
|
|
Build::Command(Build::PathFormat('support/versionchanger.pl') . ' --buildstring="-dev"');
|
|
|
|
#Build::Command(Build::PathFormat('support/versionchanger.pl'));
|
2010-04-04 23:07:37 +00:00
|
|
|
|
2011-06-29 05:50:14 +00:00
|
|
|
my $DEVENV = "C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\MSBuild.exe";
|
2010-04-04 23:24:42 +00:00
|
|
|
|
|
|
|
#Build the amxmodx builder tool.
|
|
|
|
chdir('installer/builder');
|
2013-02-13 07:22:40 +00:00
|
|
|
if ($^O eq "linux" || $^O eq "darwin") {
|
2010-04-04 23:24:42 +00:00
|
|
|
Build::Command("make");
|
|
|
|
} else {
|
2011-06-29 05:50:14 +00:00
|
|
|
Build::Command("\"$DEVENV\" builder.csproj /p:Configuration=Release /t:Rebuild");
|
2010-04-04 23:24:42 +00:00
|
|
|
}
|
|
|
|
if (!(-f 'builder.exe')) {
|
|
|
|
die "Could not find build tool.\n";
|
|
|
|
}
|
|
|
|
chdir('../..');
|
|
|
|
|
2010-04-04 23:37:28 +00:00
|
|
|
if (-d '../OUTPUT') {
|
|
|
|
Build::Delete(Cwd::abs_path('../OUTPUT'));
|
|
|
|
}
|
2010-04-04 23:42:24 +00:00
|
|
|
Build::Command("mkdir " . Build::PathFormat('../OUTPUT'));
|
2010-04-04 23:37:28 +00:00
|
|
|
|
2010-04-04 23:24:42 +00:00
|
|
|
#Output directions on how to build.
|
2010-04-04 23:07:37 +00:00
|
|
|
open(DIRECTIONS, '>installer/builder/directions.info');
|
|
|
|
if ($^O eq "linux") {
|
|
|
|
print DIRECTIONS "compress = /bin/tar\n";
|
2013-02-13 07:22:40 +00:00
|
|
|
} elsif ($^O eq "darwin") {
|
|
|
|
print DIRECTIONS "compress = /usr/bin/zip\n";
|
2010-04-04 23:07:37 +00:00
|
|
|
} else {
|
|
|
|
print DIRECTIONS "compress = C:\\WINDOWS\\zip.exe\n";
|
|
|
|
}
|
|
|
|
print DIRECTIONS "source = " . Cwd::abs_path('.') . "\n";
|
|
|
|
print DIRECTIONS "makeopts = \n";
|
|
|
|
print DIRECTIONS "output = " . Cwd::abs_path('../OUTPUT') . "\n";
|
2013-02-13 07:22:40 +00:00
|
|
|
if ($^O eq "linux" || $^O eq "darwin") {
|
2010-04-04 23:07:37 +00:00
|
|
|
print DIRECTIONS "devenv = /usr/bin/make\n";
|
|
|
|
} else {
|
2010-04-04 23:24:42 +00:00
|
|
|
print DIRECTIONS "devenv = $DEVENV\n";
|
2010-04-04 23:07:37 +00:00
|
|
|
}
|
|
|
|
print DIRECTIONS "release = amxmodx-" . Build::ProductVersion('product.version') .
|
|
|
|
"-hg" . Build::HgRevNum('.') . "\n";
|
|
|
|
close(DIRECTIONS);
|
2010-04-04 23:24:42 +00:00
|
|
|
|