electron/script/cibuild

75 строки
1.8 KiB
Plaintext
Исходник Обычный вид История

#!/usr/bin/env python
import os
import subprocess
import sys
from lib.util import execute, rm_rf, scoped_env
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
LINUX_DEPS = [
'libdbus-1-dev',
2014-11-15 05:37:27 +03:00
'libgconf2-dev',
'libgnome-keyring-dev',
'libgtk2.0-dev',
'libnotify-dev',
'gcc-multilib',
'g++-multilib',
]
2015-07-02 07:47:43 +03:00
LINUX_DEPS_ARM = [
2015-07-02 07:42:36 +03:00
'libc6-dev-armhf-cross',
'linux-libc-dev-armhf-cross',
'g++-arm-linux-gnueabihf',
]
def main():
2014-02-17 13:50:25 +04:00
os.environ['CI'] = '1'
2015-07-02 07:42:36 +03:00
target_arch = 'x64'
if os.environ.has_key('TARGET_ARCH'):
target_arch = os.environ['TARGET_ARCH']
is_travis = (os.getenv('TRAVIS') == 'true')
if is_travis and sys.platform == 'linux2':
2014-08-09 05:48:37 +04:00
print 'Setup travis CI'
execute(['sudo', 'apt-get', 'update'])
2015-07-02 07:42:36 +03:00
deps = LINUX_DEPS
if target_arch == 'arm':
2015-07-02 07:47:43 +03:00
deps += LINUX_DEPS_ARM
2015-07-02 07:42:36 +03:00
execute(['sudo', 'apt-get', 'install'] + deps)
2014-08-09 05:48:37 +04:00
os.environ['DISPLAY'] = ':99.0'
execute(['sh', '-e', '/etc/init.d/xvfb', 'start'])
rm_rf(os.path.join(SOURCE_ROOT, 'out'))
2013-12-16 11:15:33 +04:00
rm_rf(os.path.join(SOURCE_ROOT, 'node_modules'))
2014-02-02 15:58:25 +04:00
rm_rf(os.path.join(SOURCE_ROOT, 'frameworks'))
rm_rf(os.path.join(SOURCE_ROOT, 'external_binaries'))
rm_rf(os.path.join(SOURCE_ROOT, 'vendor', 'apm', 'node_modules'))
rm_rf(os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor', 'download',
'libchromiumcontent'))
2015-07-02 06:08:29 +03:00
run_script('bootstrap.py', ['--dev', '--target_arch=' + target_arch])
run_script('cpplint.py')
2014-03-03 15:31:45 +04:00
if sys.platform != 'win32':
run_script('pylint.py')
2013-09-27 06:49:55 +04:00
run_script('coffeelint.py')
2014-05-18 19:52:14 +04:00
run_script('build.py', ['-c', 'Debug'])
2015-07-02 08:18:05 +03:00
if target_arch == 'x64':
run_script('test.py', ['--ci'])
def run_script(script, args=[]):
2014-05-09 06:17:02 +04:00
print 'Running', script
script = os.path.join(SOURCE_ROOT, 'script', script)
subprocess.check_call([sys.executable, script] + args)
if __name__ == '__main__':
sys.exit(main())