Complete switch to git
This commit is contained in:
		
							parent
							
								
									7192253626
								
							
						
					
					
						commit
						28b4932b86
					
				
							
								
								
									
										6
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -1,2 +1,8 @@ | |||||||
|  | # Build output | ||||||
| /build | /build | ||||||
| /extension/version_auto.h | /extension/version_auto.h | ||||||
|  | 
 | ||||||
|  | # Breakpad stuff, it apparently has to be called src | ||||||
|  | /src | ||||||
|  | /.gclient | ||||||
|  | /.gclient_entries | ||||||
|  | |||||||
							
								
								
									
										25
									
								
								.travis.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								.travis.yml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,25 @@ | |||||||
|  | sudo: false | ||||||
|  | language: cpp | ||||||
|  | addons: | ||||||
|  |   apt: | ||||||
|  |     packages: | ||||||
|  |       - g++-multilib | ||||||
|  | compiler: | ||||||
|  |   - clang | ||||||
|  | before_script: | ||||||
|  |   - cd .. | ||||||
|  |   - git clone --depth=1 --branch=master https://chromium.googlesource.com/chromium/tools/depot_tools.git | ||||||
|  |   - git clone --depth=1 --branch=1.7-dev https://github.com/alliedmodders/sourcemod sourcemod-1.5 | ||||||
|  |   - git clone --depth=1 --branch=master https://github.com/alliedmodders/ambuild | ||||||
|  |   - cd ambuild | ||||||
|  |   - python setup.py install --user | ||||||
|  |   - cd $TRAVIS_BUILD_DIR | ||||||
|  |   - git fetch --unshallow | ||||||
|  |   - ../depot_tools/fetch breakpad | ||||||
|  | script: | ||||||
|  |   - mkdir build | ||||||
|  |   - cd build | ||||||
|  |   - python ../configure.py --enable-optimize | ||||||
|  |   - python ./build.py | ||||||
|  | after_success: | ||||||
|  |   - python ../upload.py | ||||||
| @ -1,9 +1,13 @@ | |||||||
| # vim: set ts=2 sw=2 tw=99 noet ft=python:  | # vim: set ts=2 sw=2 tw=99 noet ft=python:  | ||||||
| import os | import os | ||||||
| import urllib.request |  | ||||||
| from ambuild.command import Command | from ambuild.command import Command | ||||||
| from ambuild.command import ShellCommand | from ambuild.command import ShellCommand | ||||||
| 
 | 
 | ||||||
|  | try: | ||||||
|  | 	import urllib.request as urllib | ||||||
|  | except ImportError: | ||||||
|  | 	import urllib2 as urllib | ||||||
|  | 
 | ||||||
| class IterateDebugInfoCommand(Command): | class IterateDebugInfoCommand(Command): | ||||||
| 	def run(self, master, job): | 	def run(self, master, job): | ||||||
| 		pdblog = open(os.path.join(AMBuild.outputFolder, 'pdblog.txt'), 'rt') | 		pdblog = open(os.path.join(AMBuild.outputFolder, 'pdblog.txt'), 'rt') | ||||||
|  | |||||||
| @ -7,12 +7,13 @@ import ambuild.command as command | |||||||
| 
 | 
 | ||||||
| #Quickly try to ascertain the current repository revision | #Quickly try to ascertain the current repository revision | ||||||
| def GetVersion(): | def GetVersion(): | ||||||
| 	args = ['hg', 'parent', '-R', AMBuild.sourceFolder] | 	rev = command.RunDirectCommand(AMBuild, ['git', 'rev-list', '--count', 'HEAD']).stdoutText.strip() | ||||||
| 	p = command.RunDirectCommand(AMBuild, args) | 	cset = command.RunDirectCommand(AMBuild, ['git', 'log', '--pretty=format:%h', '-n', '1']).stdoutText.strip() | ||||||
| 	m = re.match('changeset:\s+(\d+):(.+)', p.stdoutText) | 
 | ||||||
| 	if m == None: | 	if not rev or not cset: | ||||||
| 		raise Exception('Could not determine repository version') | 		raise Exception('Could not determine repository version') | ||||||
| 	return m.groups() | 
 | ||||||
|  | 	return (rev, cset) | ||||||
| 
 | 
 | ||||||
| def PerformReversioning(): | def PerformReversioning(): | ||||||
| 	rev, cset = GetVersion() | 	rev, cset = GetVersion() | ||||||
|  | |||||||
| @ -1 +0,0 @@ | |||||||
| Lemons. |  | ||||||
| @ -13,24 +13,24 @@ def BuildEverything(): | |||||||
| 	BuildExtension(); | 	BuildExtension(); | ||||||
| 
 | 
 | ||||||
| def BuildBreakpad(): | def BuildBreakpad(): | ||||||
| 	breakpad = AMBuild.AddJob('google-breakpad') | 	breakpad = AMBuild.AddJob('breakpad') | ||||||
| 
 | 
 | ||||||
| 	if AMBuild.target['platform'] in ['linux']: | 	if AMBuild.target['platform'] in ['linux']: | ||||||
| 		if osutil.FileExists(os.path.join(AMBuild.outputFolder, 'google-breakpad', 'src', 'client', 'linux', 'libbreakpad_client.a')): | 		if osutil.FileExists(os.path.join(AMBuild.outputFolder, 'src', 'src', 'client', 'linux', 'libbreakpad_client.a')): | ||||||
| 			return | 			return | ||||||
| 
 | 
 | ||||||
| 		breakpad.AddCommand(ShellCommand('CXXFLAGS=-m32 CFLAGS=-m32 CPPFLAGS=-m32 ' + os.path.join(AMBuild.sourceFolder, 'google-breakpad', 'configure'))) | 		breakpad.AddCommand(ShellCommand('CXXFLAGS=-m32 CFLAGS=-m32 CPPFLAGS=-m32 ' + os.path.join(AMBuild.sourceFolder, 'src', 'configure'))) | ||||||
| 		breakpad.AddCommand(ShellCommand('make src/client/linux/libbreakpad_client.a')) | 		breakpad.AddCommand(ShellCommand('make src/client/linux/libbreakpad_client.a')) | ||||||
| 		 | 		 | ||||||
| 	elif AMBuild.target['platform'] in ['windows']: | 	elif AMBuild.target['platform'] in ['windows']: | ||||||
| 		if osutil.FileExists(os.path.join(AMBuild.sourceFolder, 'google-breakpad', 'src', 'client', 'windows', 'handler', 'Release', 'lib', 'exception_handler.lib')): | 		if osutil.FileExists(os.path.join(AMBuild.sourceFolder, 'src', 'src', 'client', 'windows', 'handler', 'Release', 'lib', 'exception_handler.lib')): | ||||||
| 			return | 			return | ||||||
| 		 | 		 | ||||||
| 		gyp = os.path.join(AMBuild.sourceFolder, 'google-breakpad', 'src', 'tools', 'gyp', 'gyp.bat') | 		gyp = os.path.join(AMBuild.sourceFolder, 'src', 'src', 'tools', 'gyp', 'gyp.bat') | ||||||
| 		gyppath = os.path.join(AMBuild.sourceFolder, 'google-breakpad', 'src', 'client', 'windows', 'handler', 'exception_handler.gyp') | 		gyppath = os.path.join(AMBuild.sourceFolder, 'src', 'src', 'client', 'windows', 'handler', 'exception_handler.gyp') | ||||||
| 		breakpad.AddCommand(DirectCommand([gyp, gyppath])) | 		breakpad.AddCommand(DirectCommand([gyp, gyppath])) | ||||||
| 		 | 		 | ||||||
| 		slnpath = os.path.join(AMBuild.sourceFolder, 'google-breakpad', 'src', 'client', 'windows', 'handler', 'exception_handler.sln') | 		slnpath = os.path.join(AMBuild.sourceFolder, 'src', 'src', 'client', 'windows', 'handler', 'exception_handler.sln') | ||||||
| 		breakpad.AddCommand(DirectCommand(['msbuild', slnpath, '/p:Configuration=Release'])) | 		breakpad.AddCommand(DirectCommand(['msbuild', slnpath, '/p:Configuration=Release'])) | ||||||
| 
 | 
 | ||||||
| def BuildExtension(): | def BuildExtension(): | ||||||
| @ -43,7 +43,7 @@ def BuildExtension(): | |||||||
| 	compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache['SOURCEMOD15'], 'public', 'extensions')) | 	compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache['SOURCEMOD15'], 'public', 'extensions')) | ||||||
| 	compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache['SOURCEMOD15'], 'public', 'sourcepawn')) | 	compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache['SOURCEMOD15'], 'public', 'sourcepawn')) | ||||||
| 
 | 
 | ||||||
| 	compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'google-breakpad', 'src')) | 	compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'src', 'src')) | ||||||
| 
 | 
 | ||||||
| 	if AMBuild.target['platform'] in ['linux']: | 	if AMBuild.target['platform'] in ['linux']: | ||||||
| 		compiler['POSTLINKFLAGS'].append('-lstdc++') | 		compiler['POSTLINKFLAGS'].append('-lstdc++') | ||||||
| @ -61,7 +61,7 @@ def BuildExtension(): | |||||||
| 
 | 
 | ||||||
| 	if AMBuild.target['platform'] in ['linux']: | 	if AMBuild.target['platform'] in ['linux']: | ||||||
| 		link = os.path.join(AMBuild.outputFolder, extension.workFolder, 'libbreakpad_client.a') | 		link = os.path.join(AMBuild.outputFolder, extension.workFolder, 'libbreakpad_client.a') | ||||||
| 		target = os.path.join(AMBuild.outputFolder, 'google-breakpad', 'src', 'client', 'linux', 'libbreakpad_client.a') | 		target = os.path.join(AMBuild.outputFolder, 'breakpad', 'src', 'client', 'linux', 'libbreakpad_client.a') | ||||||
| 		try: | 		try: | ||||||
| 			os.lstat(link) | 			os.lstat(link) | ||||||
| 		except: | 		except: | ||||||
| @ -71,7 +71,7 @@ def BuildExtension(): | |||||||
| 	elif AMBuild.target['platform'] in ['windows']: | 	elif AMBuild.target['platform'] in ['windows']: | ||||||
| 		libs = ['exception_handler', 'common', 'crash_generation_client'] | 		libs = ['exception_handler', 'common', 'crash_generation_client'] | ||||||
| 		for lib in libs: | 		for lib in libs: | ||||||
| 			path = os.path.join(AMBuild.sourceFolder, 'google-breakpad', 'src', 'client', 'windows', 'handler', 'Release', 'lib', lib + '.lib') | 			path = os.path.join(AMBuild.sourceFolder, 'breakpad', 'src', 'client', 'windows', 'handler', 'Release', 'lib', lib + '.lib') | ||||||
| 			if os.path.isfile(path): | 			if os.path.isfile(path): | ||||||
| 				binary.RelinkIfNewer(path) | 				binary.RelinkIfNewer(path) | ||||||
| 			binary['POSTLINKFLAGS'].extend([path]) | 			binary['POSTLINKFLAGS'].extend([path]) | ||||||
|  | |||||||
| @ -1 +1 @@ | |||||||
| 2.0.1 | 2.1.0 | ||||||
|  | |||||||
							
								
								
									
										25
									
								
								upload.py
									
									
									
									
									
								
							
							
						
						
									
										25
									
								
								upload.py
									
									
									
									
									
								
							| @ -12,26 +12,19 @@ elif sys.platform.startswith('win32'): | |||||||
| elif sys.platform.startswith('darwin'): | elif sys.platform.startswith('darwin'): | ||||||
| 	platform = 'mac' | 	platform = 'mac' | ||||||
| 
 | 
 | ||||||
| def HGVersion(): | def GITHash(): | ||||||
| 	p = subprocess.Popen(['hg', 'identify',  '-n'], stdout = subprocess.PIPE, stderr = subprocess.PIPE) | 	p = subprocess.Popen(['git', 'rev-parse', '--short', 'HEAD'], stdout = subprocess.PIPE, stderr = subprocess.PIPE) | ||||||
| 	(stdout, stderr) = p.communicate() | 	(stdout, stderr) = p.communicate() | ||||||
| 	stdout = stdout.decode('UTF-8') | 	stdout = stdout.decode('UTF-8') | ||||||
|  | 	return stdout.rstrip('\r\n') | ||||||
| 
 | 
 | ||||||
| 	return stdout.rstrip('+\r\n') | def GITVersion(): | ||||||
|  | 	p = subprocess.Popen(['git', 'rev-list', '--count', '--first-parent', 'HEAD'], stdout = subprocess.PIPE, stderr = subprocess.PIPE) | ||||||
|  | 	(stdout, stderr) = p.communicate() | ||||||
|  | 	stdout = stdout.decode('UTF-8') | ||||||
|  | 	return stdout.rstrip('\r\n') | ||||||
| 
 | 
 | ||||||
| def ReleaseVersion(): | filename = '-'.join(['accelerator', 'git' + GITVersion(), GITHash(), platform]) | ||||||
| 	productFile = open('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() |  | ||||||
| 	return '.'.join([major, minor, release]) |  | ||||||
| 
 |  | ||||||
| filename = '-'.join([os.environ.get('project', 'accelerator'), ReleaseVersion(), 'hg' + HGVersion(), platform]) |  | ||||||
| 
 | 
 | ||||||
| debug_build = os.environ.get('is_debug_build', False) == "1" | debug_build = os.environ.get('is_debug_build', False) == "1" | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user