diff --git a/atom.gyp b/atom.gyp index e70b65e78aa1..52195c316f67 100644 --- a/atom.gyp +++ b/atom.gyp @@ -15,8 +15,12 @@ 'ATOM_PRODUCT_NAME="<(product_name)"', 'ATOM_PROJECT_NAME="<(project_name)"', ], - 'mac_framework_dirs': [ - '<(source_root)/external_binaries', + 'conditions': [ + ['OS=="mac"', { + 'mac_framework_dirs': [ + '<(source_root)/external_binaries', + ], + }], ], }, 'targets': [ diff --git a/script/bootstrap.py b/script/bootstrap.py index efe96eacbb39..fd9958d9ca1a 100755 --- a/script/bootstrap.py +++ b/script/bootstrap.py @@ -2,6 +2,7 @@ import argparse import os +import subprocess import sys from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \ @@ -12,7 +13,13 @@ from lib.util import execute_stdout, get_atom_shell_version, scoped_cwd SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) VENDOR_DIR = os.path.join(SOURCE_ROOT, 'vendor') PYTHON_26_URL = 'https://chromium.googlesource.com/chromium/deps/python_26' -NPM = 'npm.cmd' if sys.platform in ['win32', 'cygwin'] else 'npm' + +if os.environ.has_key('CI'): + NPM = os.path.join(SOURCE_ROOT, 'node_modules', '.bin', 'npm') +else: + NPM = 'npm' +if sys.platform in ['win32', 'cygwin']: + NPM += '.cmd' def main(): @@ -93,16 +100,24 @@ def update_node_modules(dirname, env=None): if env is None: env = os.environ if PLATFORM == 'linux': + # Use prebuilt clang for building native modules. llvm_dir = os.path.join(SOURCE_ROOT, 'vendor', 'llvm-build', 'Release+Asserts', 'bin') env['CC'] = os.path.join(llvm_dir, 'clang') env['CXX'] = os.path.join(llvm_dir, 'clang++') env['npm_config_clang'] = '1' with scoped_cwd(dirname): + args = [NPM, 'install'] if is_verbose_mode(): - execute_stdout([NPM, 'install', '--verbose'], env) + args += '--verbose' + # Ignore npm install errors when running in CI. + if os.environ.has_key('CI'): + try: + execute_stdout(args, env) + except subprocess.CalledProcessError: + pass else: - execute_stdout([NPM, 'install'], env) + execute_stdout(args, env) def update_electron_modules(dirname, target_arch): diff --git a/script/cibuild b/script/cibuild index 4e35675f3295..1d03314f7774 100755 --- a/script/cibuild +++ b/script/cibuild @@ -4,6 +4,7 @@ import os import subprocess import sys +from lib.config import PLATFORM from lib.util import execute, rm_rf, scoped_env @@ -34,7 +35,7 @@ def main(): target_arch = os.environ['TARGET_ARCH'] is_travis = (os.getenv('TRAVIS') == 'true') - if is_travis and sys.platform == 'linux2': + if is_travis and PLATFORM == 'linux': print 'Setup travis CI' execute(['sudo', 'apt-get', 'update']) deps = LINUX_DEPS @@ -46,22 +47,33 @@ def main(): execute(['sh', '-e', '/etc/init.d/xvfb', 'start']) 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', ['--dev', '--target_arch=' + target_arch]) + # CI's npm is not reliable. + npm = 'npm.cmd' if PLATFORM == 'win32' else 'npm' + execute([npm, 'install', 'npm@2.12.1']) + + is_release = os.environ.has_key('ELECTRON_RELEASE') + args = ['--target_arch=' + target_arch] + if not is_release: + args += ['--dev'] + run_script('bootstrap.py', args) run_script('cpplint.py') - if sys.platform != 'win32': + if PLATFORM != 'win32': run_script('pylint.py') run_script('coffeelint.py') - run_script('build.py', ['-c', 'Debug']) - if target_arch == 'x64': - run_script('test.py', ['--ci']) + if is_release: + run_script('build.py', ['-c', 'R']) + run_script('create-dist.py') + elif PLATFORM == 'win32' or target_arch == 'x64': + run_script('build.py', ['-c', 'D']) + if PLATFORM != 'win32': + run_script('test.py', ['--ci']) def run_script(script, args=[]): diff --git a/script/dump-symbols.py b/script/dump-symbols.py index e072e5237b65..5c98d38a31f8 100755 --- a/script/dump-symbols.py +++ b/script/dump-symbols.py @@ -15,8 +15,8 @@ CHROMIUM_DIR = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor', def main(destination): - if PLATFORM == 'win32': - register_required_dll() + # if PLATFORM == 'win32': + # register_required_dll() rm_rf(destination) (project_name, product_name) = get_names_from_gyp() diff --git a/script/update.py b/script/update.py index a03eb44f0d60..2cbfa706e6eb 100755 --- a/script/update.py +++ b/script/update.py @@ -44,6 +44,8 @@ def run_gyp(target_arch, component): env = os.environ.copy() if PLATFORM == 'linux' and target_arch != get_host_arch(): env['GYP_CROSSCOMPILE'] = '1' + elif PLATFORM == 'win32': + env['GYP_MSVS_VERSION'] = '2013' python = sys.executable if sys.platform == 'cygwin': # Force using win32 python on cygwin. diff --git a/toolchain.gypi b/toolchain.gypi index eda53075a45f..6977847106f7 100644 --- a/toolchain.gypi +++ b/toolchain.gypi @@ -1,8 +1,5 @@ { 'variables': { - # The abosulte version of <(DEPTH). - 'source_root': '