electron/script/cibuild
2014-08-08 23:53:58 +08:00

52 lines
1.3 KiB
Python
Executable file

#!/usr/bin/env python
import os
import subprocess
import sys
from lib.util import rm_rf
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
LINUX_DEPS = [
'libgnome-keyring-dev',
'libgtk2.0-dev',
'libnotify-dev',
'gcc-multilib',
'g++-multilib',
]
def main():
os.environ['CI'] = '1'
if os.environ['TRAVIS'] == 'true' and sys.platform == 'linux2':
subprocess.check_call(['sudo', 'apt-get', 'update'])
subprocess.check_call(['sudo', 'apt-get', 'install'] + LINUX_DEPS)
rm_rf(os.path.join(SOURCE_ROOT, 'out'))
rm_rf(os.path.join(SOURCE_ROOT, 'node_modules'))
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'))
run_script('bootstrap.py')
run_script('cpplint.py')
if sys.platform != 'win32':
run_script('pylint.py')
run_script('coffeelint.py')
run_script('build.py', ['-c', 'Debug'])
run_script('test.py', ['--ci'])
def run_script(script, args=[]):
print 'Running', script
script = os.path.join(SOURCE_ROOT, 'script', script)
subprocess.check_call([sys.executable, script] + args)
if __name__ == '__main__':
sys.exit(main())