2015-04-08 14:12:47 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
2015-04-11 09:30:52 +00:00
|
|
|
from lib.config import PLATFORM
|
2015-04-12 04:45:18 +00:00
|
|
|
from lib.util import atom_gyp, execute, rm_rf
|
2015-04-08 14:12:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
|
|
|
DIST_DIR = os.path.join(SOURCE_ROOT, 'dist')
|
|
|
|
OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R')
|
|
|
|
CHROMIUM_DIR = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor',
|
|
|
|
'download', 'libchromiumcontent', 'static_library')
|
|
|
|
|
|
|
|
|
|
|
|
def main(destination):
|
2015-04-11 09:30:52 +00:00
|
|
|
if PLATFORM == 'win32':
|
2015-04-10 04:07:53 +00:00
|
|
|
register_required_dll()
|
2015-04-09 05:21:33 +00:00
|
|
|
|
2015-04-08 14:12:47 +00:00
|
|
|
rm_rf(destination)
|
|
|
|
(project_name, product_name) = get_names_from_gyp()
|
|
|
|
|
2015-04-11 09:30:52 +00:00
|
|
|
if PLATFORM in ['darwin', 'linux']:
|
2015-04-08 14:12:47 +00:00
|
|
|
# Generate the dump_syms tool.
|
|
|
|
build = os.path.join(SOURCE_ROOT, 'script', 'build.py')
|
|
|
|
execute([sys.executable, build, '-c', 'R', '-t', 'dump_syms'])
|
|
|
|
|
|
|
|
generate_breakpad_symbols = os.path.join(SOURCE_ROOT, 'tools', 'posix',
|
|
|
|
'generate_breakpad_symbols.py')
|
2015-04-11 09:30:52 +00:00
|
|
|
if PLATFORM == 'darwin':
|
2015-04-08 14:12:47 +00:00
|
|
|
start = os.path.join(OUT_DIR, '{0}.app'.format(product_name), 'Contents',
|
|
|
|
'MacOS', product_name)
|
|
|
|
else:
|
|
|
|
start = os.path.join(OUT_DIR, project_name)
|
|
|
|
args = [
|
|
|
|
'--build-dir={0}'.format(OUT_DIR),
|
|
|
|
'--binary={0}'.format(start),
|
|
|
|
'--symbols-dir={0}'.format(destination),
|
|
|
|
'--libchromiumcontent-dir={0}'.format(CHROMIUM_DIR),
|
|
|
|
'--clear',
|
|
|
|
'--jobs=16',
|
|
|
|
]
|
|
|
|
else:
|
|
|
|
generate_breakpad_symbols = os.path.join(SOURCE_ROOT, 'tools', 'win',
|
|
|
|
'generate_breakpad_symbols.py')
|
|
|
|
args = [
|
|
|
|
'--symbols-dir={0}'.format(destination),
|
|
|
|
'--jobs=16',
|
2015-04-09 05:21:33 +00:00
|
|
|
os.path.relpath(OUT_DIR),
|
2015-04-08 14:12:47 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
execute([sys.executable, generate_breakpad_symbols] + args)
|
|
|
|
|
|
|
|
|
2015-04-09 05:21:33 +00:00
|
|
|
def register_required_dll():
|
|
|
|
register = os.path.join(SOURCE_ROOT, 'tools', 'win',
|
|
|
|
'register_msdia80_dll.js')
|
|
|
|
execute(['node.exe', os.path.relpath(register)]);
|
|
|
|
|
|
|
|
|
2015-04-08 14:12:47 +00:00
|
|
|
def get_names_from_gyp():
|
2015-04-12 04:45:18 +00:00
|
|
|
variables = atom_gyp()
|
|
|
|
return (variables['project_name%'], variables['product_name%'])
|
2015-04-08 14:12:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
sys.exit(main(sys.argv[1]))
|