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',
26 'libc6-dev-armhf-cross',
27 'linux-libc-dev-armhf-cross',
28 'g++-arm-linux-gnueabihf',
33 os.environ['CI'] = '1'
36 if os.environ.has_key('TARGET_ARCH'):
37 target_arch = os.environ['TARGET_ARCH']
39 is_travis = (os.getenv('TRAVIS') == 'true')
40 if is_travis and PLATFORM == 'linux':
41 print 'Setup travis CI'
42 execute(['sudo', 'apt-get', 'update'])
44 if target_arch == 'arm':
45 deps += LINUX_DEPS_ARM
46 execute(['sudo', 'apt-get', 'install'] + deps)
48 execute(['sh', '-e', '/etc/init.d/xvfb', 'start'])
50 if PLATFORM == 'linux':
51 os.environ['DISPLAY'] = ':99.0'
53 run_script('clean.py')
55 # CI's npm is not reliable.
56 npm = 'npm.cmd' if PLATFORM == 'win32' else 'npm'
57 execute([npm, 'install', 'npm@2.12.1'])
59 is_release = os.environ.has_key('ELECTRON_RELEASE')
60 args = ['--target_arch=' + target_arch]
63 run_script('bootstrap.py', args)
65 run_script('cpplint.py')
66 if PLATFORM != 'win32':
67 run_script('pylint.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__':