Only rebuild test modules on non-Windows or release builds
This commit is contained in:
parent
9971f0d54c
commit
0d4a397656
2 changed files with 18 additions and 7 deletions
|
@ -265,7 +265,7 @@ def update_electron_modules(dirname, target_arch, nodedir):
|
||||||
env['npm_config_target'] = version
|
env['npm_config_target'] = version
|
||||||
env['npm_config_nodedir'] = nodedir
|
env['npm_config_nodedir'] = nodedir
|
||||||
update_node_modules(dirname, env)
|
update_node_modules(dirname, env)
|
||||||
execute_stdout([NPM, 'rebuild'], env)
|
execute_stdout([NPM, 'rebuild'], env, dirname)
|
||||||
|
|
||||||
|
|
||||||
def update_node_modules(dirname, env=None):
|
def update_node_modules(dirname, env=None):
|
||||||
|
|
|
@ -28,8 +28,7 @@ def main():
|
||||||
|
|
||||||
spec_modules = os.path.join(SOURCE_ROOT, 'spec', 'node_modules')
|
spec_modules = os.path.join(SOURCE_ROOT, 'spec', 'node_modules')
|
||||||
if args.rebuild_native_modules or not os.path.isdir(spec_modules):
|
if args.rebuild_native_modules or not os.path.isdir(spec_modules):
|
||||||
rebuild_native_modules(spec_modules,
|
rebuild_native_modules(config, spec_modules)
|
||||||
os.path.join(SOURCE_ROOT, 'out', config))
|
|
||||||
|
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
electron = os.path.join(SOURCE_ROOT, 'out', config,
|
electron = os.path.join(SOURCE_ROOT, 'out', config,
|
||||||
|
@ -79,6 +78,10 @@ def parse_args():
|
||||||
help='Rebuild native modules used by specs',
|
help='Rebuild native modules used by specs',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
required=False)
|
required=False)
|
||||||
|
parser.add_argument('--ci',
|
||||||
|
help='Run tests in CI mode',
|
||||||
|
action='store_true',
|
||||||
|
required=False)
|
||||||
parser.add_argument('-v', '--verbose',
|
parser.add_argument('-v', '--verbose',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
help='Prints the output of the subprocesses')
|
help='Prints the output of the subprocesses')
|
||||||
|
@ -112,20 +115,28 @@ def run_python_script(script, *args):
|
||||||
return execute([sys.executable, script_path] + list(args))
|
return execute([sys.executable, script_path] + list(args))
|
||||||
|
|
||||||
|
|
||||||
def rebuild_native_modules(modules_path, out_dir):
|
def rebuild_native_modules(config, modules_path):
|
||||||
|
out_dir = os.path.join(SOURCE_ROOT, 'out', config)
|
||||||
version = get_electron_version()
|
version = get_electron_version()
|
||||||
|
node_dir = os.path.join(out_dir, 'node-{0}'.format(version))
|
||||||
|
|
||||||
run_python_script('create-node-headers.py',
|
run_python_script('create-node-headers.py',
|
||||||
'--version', version,
|
'--version', version,
|
||||||
'--directory', out_dir)
|
'--directory', out_dir)
|
||||||
|
|
||||||
if PLATFORM == 'win32':
|
if PLATFORM == 'win32':
|
||||||
iojs_lib = os.path.join(out_dir, 'Release', 'iojs.lib')
|
lib_dir = os.path.join(node_dir, 'Release')
|
||||||
|
safe_mkdir(lib_dir)
|
||||||
|
iojs_lib = os.path.join(lib_dir, 'iojs.lib')
|
||||||
atom_lib = os.path.join(out_dir, 'node.dll.lib')
|
atom_lib = os.path.join(out_dir, 'node.dll.lib')
|
||||||
shutil.copy2(atom_lib, iojs_lib)
|
shutil.copy2(atom_lib, iojs_lib)
|
||||||
|
|
||||||
|
# Native modules can only be compiled against release builds on Windows
|
||||||
|
if config == 'R' or PLATFORM != 'win32':
|
||||||
update_electron_modules(os.path.dirname(modules_path), get_target_arch(),
|
update_electron_modules(os.path.dirname(modules_path), get_target_arch(),
|
||||||
os.path.join(out_dir, 'node-{0}'.format(version)))
|
node_dir)
|
||||||
|
else:
|
||||||
|
update_node_modules(os.path.dirname(modules_path))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue