Overhaul of many things.

This commit is contained in:
Asher Baker
2012-11-05 16:00:51 +00:00
parent 504d6befd2
commit fe52823b62
13 changed files with 350 additions and 100 deletions
+41
View File
@@ -0,0 +1,41 @@
# vim: set ts=2 sw=2 tw=99 noet ft=python:
import os
import urllib.request
from ambuild.command import Command
from ambuild.command import ShellCommand
class IterateDebugInfoCommand(Command):
def run(self, master, job):
pdblog = open(os.path.join(AMBuild.outputFolder, 'pdblog.txt'), 'rt')
for debug_info in pdblog:
debug_info = os.path.join(AMBuild.outputFolder, debug_info.strip())
job.AddCommand(SymbolCommand(debug_info, symbolServer))
pdblog.close()
class SymbolCommand(ShellCommand):
def __init__(self, debugFile, symbolServer):
self.serverResponse = None
self.symbolServer = symbolServer
if AMBuild.target['platform'] == 'linux':
cmdstring = "dump_syms {0} {1}".format(debugFile, os.path.dirname(debugFile))
elif AMBuild.target['platform'] == 'darwin':
cmdstring = "dump_syms {0}".format(debugFile)
elif AMBuild.target['platform'] == 'windows':
cmdstring = "dump_syms.exe {0}".format(debugFile)
ShellCommand.__init__(self, cmdstring)
def run(self, master, job):
ShellCommand.run(self, master, job)
if self.stdout != None and len(self.stdout) > 0:
request = urllib.request.Request(symbolServer, self.stdout.encode('utf-8'))
request.add_header("Content-Type", "text/plain")
self.serverResponse = urllib.request.urlopen(request).read().decode('utf-8')
def spew(self, runner):
if self.stderr != None and len(self.stderr) > 0:
runner.PrintOut(self.stderr)
if self.serverResponse != None and len(self.serverResponse) > 0:
runner.PrintOut(self.serverResponse)
if 'BREAKPAD_SYMBOL_SERVER' in os.environ:
symbolServer = os.environ['BREAKPAD_SYMBOL_SERVER']
job = AMBuild.AddJob('breakpad-symbols')
job.AddCommand(IterateDebugInfoCommand())
+14 -8
View File
@@ -86,7 +86,14 @@ bincopies = []
def AddNormalLibrary(name, dest):
dest = os.path.join('addons', 'sourcemod', dest)
bincopies.append(CopyFile(os.path.join('..', name, name + osutil.SharedLibSuffix()), dest))
#pdb_list.append(name + '\\' + name + '.pdb')
# Each platform's version of dump_syms needs the path in a different format.
if AMBuild.target['platform'] == 'linux':
debug_info.append(name + '/' + name + '.so')
elif AMBuild.target['platform'] == 'darwin':
debug_info.append(name + '/' + name + '.dylib.dSYM')
elif AMBuild.target['platform'] == 'windows':
debug_info.append(name + '\\' + name + '.pdb')
def AddHL2Library(name, dest):
for i in SM.sdkInfo:
@@ -95,15 +102,14 @@ def AddHL2Library(name, dest):
continue
AddNormalLibrary(name + '.ext.' + sdk['ext'], dest)
#pdb_list = []
debug_info = []
AddHL2Library('connect', 'extensions')
job.AddCommandGroup(bincopies)
#if AMBuild.target['platform'] == 'windows':
# pdblog = open(os.path.join(AMBuild.outputFolder, 'pdblog.txt'), 'wt')
# for pdb in pdb_list:
# pdblog.write(pdb + '\n')
# pdblog.close()
pdblog = open(os.path.join(AMBuild.outputFolder, 'pdblog.txt'), 'wt')
for pdb in debug_info:
pdblog.write(pdb + '\n')
pdblog.close()
+55
View File
@@ -0,0 +1,55 @@
# vim: set ts=2 sw=2 tw=99 noet ft=python:
import os
import re
import subprocess
from ambuild.cache import Cache
import ambuild.command as command
#Quickly try to ascertain the current repository revision
def GetVersion():
args = ['hg', 'parent', '-R', AMBuild.sourceFolder]
p = command.RunDirectCommand(AMBuild, args)
m = re.match('changeset:\s+(\d+):(.+)', p.stdoutText)
if m == None:
raise Exception('Could not determine repository version')
return m.groups()
def PerformReversioning():
rev, cset = GetVersion()
cacheFile = os.path.join(AMBuild.outputFolder, '.ambuild', 'hgcache')
cache = Cache(cacheFile)
if os.path.isfile(cacheFile):
cache.LoadCache()
if cache.HasVariable('cset') and cache['cset'] == cset:
return False
cache.CacheVariable('cset', cset)
productFile = open(os.path.join(AMBuild.sourceFolder, 'buildbot', 'product.version'), 'r')
productContents = productFile.read()
productFile.close()
m = re.match('(\d+)\.(\d+)\.(\d+)(.*)', productContents)
if m == None:
raise Exception('Could not detremine product version')
major, minor, release, tag = m.groups()
incFolder = os.path.join(AMBuild.sourceFolder, 'extension')
incFile = open(os.path.join(incFolder, 'version_auto.h'), 'w')
incFile.write("""
#ifndef _AUTO_VERSION_INFORMATION_H_
#define _AUTO_VERSION_INFORMATION_H_
#define SM_BUILD_TAG \"{0}\"
#define SM_BUILD_UNIQUEID \"{1}:{2}\" SM_BUILD_TAG
#define SM_VERSION \"{3}.{4}.{5}\"
#define SM_FULL_VERSION SM_VERSION SM_BUILD_TAG
#define SM_FILE_VERSION {6},{7},{8},0
#endif /* _AUTO_VERSION_INFORMATION_H_ */
""".format(tag, rev, cset, major, minor, release, major, minor, release))
incFile.close()
cache.WriteCache()
PerformReversioning()
+3 -3
View File
@@ -26,17 +26,17 @@ print "Attempting to reconfigure...\n";
#update and configure shiz
if ($^O eq "linux") {
$ENV{'SOURCEMOD14'} = '/home/builds/common/sourcemod-1.4';
$ENV{'MMSOURCE18'} = '/home/builds/common/mmsource-1.8';
$ENV{'MMSOURCE19'} = '/home/builds/common/mmsource-1.9';
$ENV{'HL2SDKOBVALVE'} = '/home/builds/common/hl2sdk-ob-valve';
} elsif ($^O eq "darwin") {
$ENV{'SOURCEMOD14'} = '/Users/builds/slaves/common/sourcemod-1.4';
$ENV{'MMSOURCE18'} = '/Users/builds/slaves/common/mmsource-1.8';
$ENV{'MMSOURCE19'} = '/Users/builds/slaves/common/mmsource-1.9';
$ENV{'HL2SDKOBVALVE'} = '/Users/builds/slaves/common/hl2sdk-ob-valve';
} else {
$ENV{'SOURCEMOD14'} = 'C:/Scripts/common/sourcemod-1.4';
$ENV{'MMSOURCE18'} = 'C:/Scripts/common/mmsource-1.8';
$ENV{'MMSOURCE19'} = 'C:/Scripts/common/mmsource-1.9';
#$ENV{'HL2SDKOBVALVE'} = 'H:/hl2sdk-ob-valve';
}
+1 -1
View File
@@ -1 +1 @@
1.1.0
1.2.0
+8
View File
@@ -10,6 +10,14 @@ 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 {