7 from lib.config import PLATFORM
8 from lib.util import execute, rm_rf, scoped_env
11 SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
16 'libgnome-keyring-dev',
25 'libc6-dev-armhf-cross',
26 'linux-libc-dev-armhf-cross',
27 'g++-arm-linux-gnueabihf',
32 os.environ['CI'] = '1'
35 if os.environ.has_key('TARGET_ARCH'):
36 target_arch = os.environ['TARGET_ARCH']
38 is_travis = (os.getenv('TRAVIS') == 'true')
39 if is_travis and PLATFORM == 'linux':
40 print 'Setup travis CI'
41 execute(['sudo', 'apt-get', 'update'])
43 if target_arch == 'arm':
44 deps += LINUX_DEPS_ARM
45 execute(['sudo', 'apt-get', 'install'] + deps)
47 execute(['sh', '-e', '/etc/init.d/xvfb', 'start'])
49 if PLATFORM == 'linux':
50 os.environ['DISPLAY'] = ':99.0'
52 run_script('clean.py')
54 # CI's npm is not reliable.
55 npm = 'npm.cmd' if PLATFORM == 'win32' else 'npm'
56 execute([npm, 'install', 'npm@2.12.1'])
58 is_release = os.environ.has_key('ELECTRON_RELEASE')
59 args = ['--target_arch=' + target_arch]
62 run_script('bootstrap.py', args)
64 run_script('cpplint.py')
65 if PLATFORM != 'win32':
66 run_script('pylint.py')
67 run_script('coffeelint.py')
69 run_script('build.py', ['-c', 'R'])
70 run_script('create-dist.py')
71 run_script('upload.py')
73 run_script('build.py', ['-c', 'D'])
74 if PLATFORM != 'win32' and target_arch == 'x64':
75 run_script('test.py', ['--ci'])
77 run_script('clean.py')
80 def run_script(script, args=[]):
81 sys.stderr.write('\nRunning ' + script +'\n')
83 script = os.path.join(SOURCE_ROOT, 'script', script)
84 subprocess.check_call([sys.executable, script] + args)
87 if __name__ == '__main__':