Merge pull request #2107 from atom/win-ci

Build in Windows CI
This commit is contained in:
Cheng Zhao 2015-07-03 11:28:16 +08:00
commit 8f06bd6f3e
6 changed files with 52 additions and 17 deletions

View file

@ -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': [

View file

@ -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):

View file

@ -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=[]):

View file

@ -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()

View file

@ -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.

View file

@ -1,8 +1,5 @@
{
'variables': {
# The abosulte version of <(DEPTH).
'source_root': '<!(cd <(DEPTH) && pwd -P)',
# Clang stuff.
'make_clang_dir%': 'vendor/llvm-build/Release+Asserts',
# Set this to true when building with Clang.
@ -33,6 +30,11 @@
'clang%': 0,
}], # OS=="win"
# Define the abosulte version of <(DEPTH).
['OS!="win"', {
'source_root': '<!(cd <(DEPTH) && pwd -P)',
}], # OS!="win"
# Set default compiler flags depending on ARM version.
['arm_version==6', {
'arm_arch%': 'armv6',