Updated build scipts.
This commit is contained in:
+1
-1
@@ -24,7 +24,7 @@ def PerformReversioning():
|
||||
return False
|
||||
cache.CacheVariable('cset', cset)
|
||||
|
||||
productFile = open(os.path.join(AMBuild.sourceFolder, 'buildbot', 'product.version'), 'r')
|
||||
productFile = open(os.path.join(AMBuild.sourceFolder, 'product.version'), 'r')
|
||||
productContents = productFile.read()
|
||||
productFile.close()
|
||||
m = re.match('(\d+)\.(\d+)\.(\d+)(.*)', productContents)
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
# vim: set ts=2 sw=2 tw=99 noet:
|
||||
|
||||
use strict;
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
use File::Path;
|
||||
|
||||
my ($myself, $path) = fileparse($0);
|
||||
chdir($path);
|
||||
|
||||
require 'helpers.pm';
|
||||
|
||||
#Go back above build dir
|
||||
chdir(Build::PathFormat('../..'));
|
||||
|
||||
#Get the source path.
|
||||
our ($root) = getcwd();
|
||||
|
||||
rmtree('OUTPUT');
|
||||
mkdir('OUTPUT') or die("Failed to create output folder: $!\n");
|
||||
chdir('OUTPUT');
|
||||
my ($result);
|
||||
print "Attempting to reconfigure...\n";
|
||||
|
||||
#update and configure shiz
|
||||
if ($^O eq "linux") {
|
||||
$ENV{'SOURCEMOD14'} = '/home/builds/common/sourcemod-1.4';
|
||||
$ENV{'MMSOURCE19'} = '/home/builds/common/mmsource-1.9';
|
||||
|
||||
$ENV{'HL2SDKOBVALVE'} = '/home/builds/common/hl2sdk-ob-valve';
|
||||
$ENV{'HL2SDKCSS'} = '/home/builds/common/hl2sdk-css';
|
||||
} elsif ($^O eq "darwin") {
|
||||
$ENV{'SOURCEMOD14'} = '/Users/builds/slaves/common/sourcemod-1.4';
|
||||
$ENV{'MMSOURCE19'} = '/Users/builds/slaves/common/mmsource-1.9';
|
||||
|
||||
$ENV{'HL2SDKOBVALVE'} = '/Users/builds/slaves/common/hl2sdk-ob-valve';
|
||||
$ENV{'HL2SDKCSS'} = '/Users/builds/slaves/common/hl2sdk-css';
|
||||
} else {
|
||||
$ENV{'SOURCEMOD14'} = 'C:/Scripts/common/sourcemod-1.4';
|
||||
$ENV{'MMSOURCE19'} = 'C:/Scripts/common/mmsource-1.9';
|
||||
|
||||
#$ENV{'HL2SDKOBVALVE'} = 'H:/hl2sdk-ob-valve';
|
||||
#$ENV{'HL2SDKCSS'} = 'H:/hl2sdk-css';
|
||||
}
|
||||
|
||||
#configure AMBuild
|
||||
if ($^O eq "linux") {
|
||||
$result = `CC=gcc CXX=gcc python3 ../build/configure.py --enable-optimize`;
|
||||
} elsif ($^O eq "darwin") {
|
||||
$result = `CC=clang CXX=clang python3 ../build/configure.py --enable-optimize`;
|
||||
} else {
|
||||
$result = `C:\\Python31\\Python.exe ..\\build\\configure.py --enable-optimize`;
|
||||
}
|
||||
print "$result\n";
|
||||
if ($? != 0) {
|
||||
die('Could not configure!');
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use Cwd;
|
||||
|
||||
package Build;
|
||||
|
||||
sub HgRevNum
|
||||
{
|
||||
my ($path) = (@_);
|
||||
my ($cd, $text, $rev);
|
||||
|
||||
$cd = Cwd::cwd();
|
||||
chdir($path);
|
||||
$text = `hg identify -n`;
|
||||
chdir($cd);
|
||||
|
||||
chomp $text;
|
||||
if ($text =~ /^(\d+)/)
|
||||
{
|
||||
return $1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub ProductVersion
|
||||
{
|
||||
my ($file) = (@_);
|
||||
my ($version);
|
||||
open(FILE, $file) or die "Could not open $file: $!\n";
|
||||
$version = <FILE>;
|
||||
close(FILE);
|
||||
chomp $version;
|
||||
return $version;
|
||||
}
|
||||
|
||||
sub Delete
|
||||
{
|
||||
my ($str)=(@_);
|
||||
if ($^O =~ /MSWin/)
|
||||
{
|
||||
Command("del /S /F /Q \"$str\"");
|
||||
Command("rmdir /S /Q \"$str\"");
|
||||
} else {
|
||||
Command("rm -rf $str");
|
||||
}
|
||||
return !(-e $str);
|
||||
}
|
||||
|
||||
sub Copy
|
||||
{
|
||||
my ($src,$dest)=(@_);
|
||||
if ($^O =~ /MSWin/)
|
||||
{
|
||||
Command("copy \"$src\" \"$dest\" /y");
|
||||
} else {
|
||||
Command("cp \"$src\" \"$dest\"");
|
||||
}
|
||||
return (-e $dest);
|
||||
}
|
||||
|
||||
sub Move
|
||||
{
|
||||
my ($src,$dest)=(@_);
|
||||
if ($^O =~ /MSWin/)
|
||||
{
|
||||
Command("move \"$src\" \"$dest\"");
|
||||
} else {
|
||||
Command("mv \"$src\" \"$dest\"");
|
||||
}
|
||||
return (-e $dest);
|
||||
}
|
||||
|
||||
sub Command
|
||||
{
|
||||
my($cmd)=(@_);
|
||||
print "$cmd\n";
|
||||
return `$cmd`;
|
||||
}
|
||||
|
||||
sub PathFormat
|
||||
{
|
||||
my ($str)=(@_);
|
||||
if ($^O =~ /MSWin/)
|
||||
{
|
||||
$str =~ s#/#\\#g;
|
||||
} else {
|
||||
$str =~ s#\\#/#g;
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@@ -1,82 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
use Net::FTP;
|
||||
|
||||
my ($ftp_host, $ftp_user, $ftp_pass, $ftp_path);
|
||||
|
||||
$ftp_host = $ARGV[0];
|
||||
$ftp_user = $ARGV[1];
|
||||
$ftp_pass = $ARGV[2];
|
||||
$ftp_path = $ARGV[3];
|
||||
|
||||
my ($myself, $path) = fileparse($0);
|
||||
chdir($path);
|
||||
|
||||
require 'helpers.pm';
|
||||
|
||||
my ($version);
|
||||
$version = Build::ProductVersion(Build::PathFormat('product.version'));
|
||||
$version .= '-hg' . Build::HgRevNum('.');
|
||||
|
||||
# Append OS to package version
|
||||
if ($^O eq "darwin")
|
||||
{
|
||||
$version .= '-mac';
|
||||
}
|
||||
elsif ($^O =~ /MSWin/)
|
||||
{
|
||||
$version .= '-windows';
|
||||
}
|
||||
else
|
||||
{
|
||||
$version .= '-' . $^O;
|
||||
}
|
||||
|
||||
#Switch to the output folder.
|
||||
chdir(Build::PathFormat('../../OUTPUT/package'));
|
||||
|
||||
my ($filename);
|
||||
$filename = 'connect-' . $version;
|
||||
if ($^O eq "linux")
|
||||
{
|
||||
$filename .= '.tar.gz';
|
||||
print "tar zcvf $filename addons\n";
|
||||
system("tar zcvf $filename addons");
|
||||
}
|
||||
else
|
||||
{
|
||||
$filename .= '.zip';
|
||||
print "zip -r $filename addons\n";
|
||||
system("zip -r $filename addons");
|
||||
}
|
||||
|
||||
#my ($major,$minor) = ($version =~ /^(\d+)\.(\d+)/);
|
||||
#$ftp_path .= "/$major.$minor";
|
||||
|
||||
my ($ftp);
|
||||
|
||||
$ftp = Net::FTP->new($ftp_host, Debug => 0)
|
||||
or die "Cannot connect to host $ftp_host : $@";
|
||||
|
||||
$ftp->login($ftp_user, $ftp_pass)
|
||||
or die "Cannot connect to host $ftp_host as $ftp_user : " . $ftp->message . "\n";
|
||||
|
||||
if ($ftp_path ne '')
|
||||
{
|
||||
$ftp->cwd($ftp_path)
|
||||
or die "Cannot change to folder $ftp_path : " . $ftp->message . "\n";
|
||||
}
|
||||
|
||||
$ftp->binary();
|
||||
$ftp->put($filename)
|
||||
or die "Cannot drop file $filename ($ftp_path) : " . $ftp->message . "\n";
|
||||
|
||||
$ftp->close();
|
||||
|
||||
print "File sent to drop site as $filename -- build succeeded.\n";
|
||||
|
||||
exit(0);
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
1.2.0
|
||||
@@ -1,35 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
# vim: set ts=2 sw=2 tw=99 noet:
|
||||
|
||||
use File::Basename;
|
||||
|
||||
my ($myself, $path) = fileparse($0);
|
||||
chdir($path);
|
||||
|
||||
require 'helpers.pm';
|
||||
|
||||
chdir('../../OUTPUT');
|
||||
|
||||
$ENV{'BREAKPAD_SYMBOL_SERVER'} = 'http://crash.limetech.org/submit-symbols';
|
||||
|
||||
if ($^O eq "linux") {
|
||||
$ENV{'PATH'} .= ':/home/builds/common/';
|
||||
} elsif ($^O eq "darwin") {
|
||||
$ENV{'PATH'} .= ':/Users/builds/slaves/common/';
|
||||
}
|
||||
|
||||
if ($^O eq "linux" || $^O eq "darwin") {
|
||||
system("python3 build.py 2>&1");
|
||||
} else {
|
||||
system("C:\\Python31\\python.exe build.py 2>&1");
|
||||
}
|
||||
|
||||
if ($? != 0)
|
||||
{
|
||||
die "Build failed: $!\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user