| 
									
										
										
										
											2013-08-21 11:15:22 +08:00
										 |  |  | #!/usr/bin/env python | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import os | 
					
						
							|  |  |  | import subprocess | 
					
						
							| 
									
										
										
										
											2013-08-21 21:41:34 +08:00
										 |  |  | import sys | 
					
						
							| 
									
										
										
										
											2013-08-21 11:15:22 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-26 09:39:24 +08:00
										 |  |  | from lib.util import rm_rf | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-08-21 11:15:22 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-08-21 21:41:34 +08:00
										 |  |  | SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def main(): | 
					
						
							| 
									
										
										
										
											2014-02-17 17:50:25 +08:00
										 |  |  |   os.environ['CI'] = '1' | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-26 09:39:24 +08:00
										 |  |  |   rm_rf(os.path.join(SOURCE_ROOT, 'out')) | 
					
						
							| 
									
										
										
										
											2013-12-16 15:15:33 +08:00
										 |  |  |   rm_rf(os.path.join(SOURCE_ROOT, 'node_modules')) | 
					
						
							| 
									
										
										
										
											2014-02-02 19:58:25 +08:00
										 |  |  |   rm_rf(os.path.join(SOURCE_ROOT, 'frameworks')) | 
					
						
							| 
									
										
										
										
											2014-03-11 00:01:06 +08:00
										 |  |  |   rm_rf(os.path.join(SOURCE_ROOT, 'vendor', 'apm', 'node_modules')) | 
					
						
							| 
									
										
										
										
											2013-11-26 11:04:37 +08:00
										 |  |  |   rm_rf(os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor', 'download', | 
					
						
							|  |  |  |                      'libchromiumcontent')) | 
					
						
							| 
									
										
										
										
											2013-11-26 09:39:24 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-08-21 21:41:34 +08:00
										 |  |  |   run_script('bootstrap.py') | 
					
						
							|  |  |  |   run_script('cpplint.py') | 
					
						
							| 
									
										
										
										
											2014-03-03 11:31:45 +00:00
										 |  |  |   if sys.platform != 'win32': | 
					
						
							|  |  |  |     run_script('pylint.py') | 
					
						
							| 
									
										
										
										
											2013-09-27 10:49:55 +08:00
										 |  |  |   run_script('coffeelint.py') | 
					
						
							| 
									
										
										
										
											2013-08-21 21:41:34 +08:00
										 |  |  |   run_script('build.py') | 
					
						
							|  |  |  |   run_script('test.py', ['--ci']) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def run_script(script, args=[]): | 
					
						
							| 
									
										
										
										
											2014-05-09 10:17:02 +08:00
										 |  |  |   print 'Running', script | 
					
						
							| 
									
										
										
										
											2013-08-21 21:41:34 +08:00
										 |  |  |   script = os.path.join(SOURCE_ROOT, 'script', script) | 
					
						
							|  |  |  |   subprocess.check_call([sys.executable, script] + args) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if __name__ == '__main__': | 
					
						
							|  |  |  |   sys.exit(main()) |