зеркало из https://github.com/electron/electron.git
Create symbols zip file when creating distribution.
This commit is contained in:
Родитель
1d2de6d1fb
Коммит
e4b4087fdb
2
atom.gyp
2
atom.gyp
|
@ -415,7 +415,7 @@
|
||||||
'tools/mac/generate_breakpad_symbols.py',
|
'tools/mac/generate_breakpad_symbols.py',
|
||||||
'--build-dir=<(PRODUCT_DIR)',
|
'--build-dir=<(PRODUCT_DIR)',
|
||||||
'--binary=<(PRODUCT_DIR)/<(product_name).app/Contents/MacOS/<(product_name)',
|
'--binary=<(PRODUCT_DIR)/<(product_name).app/Contents/MacOS/<(product_name)',
|
||||||
'--symbols-dir=<(PRODUCT_DIR)/<(product_name).breakpad.syms',
|
'--symbols-dir=<(PRODUCT_DIR)/atom-shell.breakpad.syms',
|
||||||
'--clear',
|
'--clear',
|
||||||
'--jobs=16',
|
'--jobs=16',
|
||||||
],
|
],
|
||||||
|
|
|
@ -69,11 +69,13 @@ def main():
|
||||||
os.makedirs(DIST_DIR)
|
os.makedirs(DIST_DIR)
|
||||||
|
|
||||||
force_build()
|
force_build()
|
||||||
|
create_symbols()
|
||||||
copy_binaries()
|
copy_binaries()
|
||||||
copy_headers()
|
copy_headers()
|
||||||
copy_license()
|
copy_license()
|
||||||
create_version()
|
create_version()
|
||||||
create_zip()
|
create_dist_zip()
|
||||||
|
create_symbols_zip()
|
||||||
create_header_tarball()
|
create_header_tarball()
|
||||||
|
|
||||||
|
|
||||||
|
@ -131,7 +133,20 @@ def create_version():
|
||||||
version_file.write(ATOM_SHELL_VRESION)
|
version_file.write(ATOM_SHELL_VRESION)
|
||||||
|
|
||||||
|
|
||||||
def create_zip():
|
def create_symbols():
|
||||||
|
out_dir = os.path.join(SOURCE_ROOT, 'out', 'Release')
|
||||||
|
|
||||||
|
build = os.path.join(SOURCE_ROOT, 'script', 'build.py')
|
||||||
|
subprocess.check_output([sys.executable, build, '-c', 'Release',
|
||||||
|
'-t', 'atom_dump_symbols'])
|
||||||
|
|
||||||
|
directory = 'atom-shell.breakpad.syms'
|
||||||
|
shutil.copytree(os.path.join(out_dir, directory),
|
||||||
|
os.path.join(DIST_DIR, directory),
|
||||||
|
symlinks=True)
|
||||||
|
|
||||||
|
|
||||||
|
def create_dist_zip():
|
||||||
dist_name = 'atom-shell-{0}-{1}.zip'.format(ATOM_SHELL_VRESION,
|
dist_name = 'atom-shell-{0}-{1}.zip'.format(ATOM_SHELL_VRESION,
|
||||||
TARGET_PLATFORM)
|
TARGET_PLATFORM)
|
||||||
zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)
|
zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)
|
||||||
|
@ -142,6 +157,17 @@ def create_zip():
|
||||||
make_zip(zip_file, files, dirs)
|
make_zip(zip_file, files, dirs)
|
||||||
|
|
||||||
|
|
||||||
|
def create_symbols_zip():
|
||||||
|
dist_name = 'atom-shell-{0}-{1}-symbols.zip'.format(ATOM_SHELL_VRESION,
|
||||||
|
TARGET_PLATFORM)
|
||||||
|
zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)
|
||||||
|
|
||||||
|
with scoped_cwd(DIST_DIR):
|
||||||
|
files = ['LICENSE', 'version']
|
||||||
|
dirs = ['atom-shell.breakpad.syms']
|
||||||
|
make_zip(zip_file, files, dirs)
|
||||||
|
|
||||||
|
|
||||||
def create_header_tarball():
|
def create_header_tarball():
|
||||||
with scoped_cwd(DIST_DIR):
|
with scoped_cwd(DIST_DIR):
|
||||||
tarball = tarfile.open(name=DIST_HEADERS_DIR + '.tar.gz', mode='w:gz')
|
tarball = tarfile.open(name=DIST_HEADERS_DIR + '.tar.gz', mode='w:gz')
|
||||||
|
|
|
@ -59,7 +59,7 @@ def extract_tarball(tarball_path, member, destination):
|
||||||
def extract_zip(zip_path, destination):
|
def extract_zip(zip_path, destination):
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
# Use unzip command on Mac to keep symbol links in zip file work.
|
# Use unzip command on Mac to keep symbol links in zip file work.
|
||||||
subprocess.check_call(['unzip', zip_path, '-d', destination])
|
subprocess.check_output(['unzip', zip_path, '-d', destination])
|
||||||
else:
|
else:
|
||||||
with zipfile.ZipFile(zip_path) as z:
|
with zipfile.ZipFile(zip_path) as z:
|
||||||
z.extractall(destination)
|
z.extractall(destination)
|
||||||
|
@ -68,7 +68,7 @@ def make_zip(zip_file_path, files, dirs):
|
||||||
safe_unlink(zip_file_path)
|
safe_unlink(zip_file_path)
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
files += dirs
|
files += dirs
|
||||||
subprocess.check_call(['zip', '-r', '-y', zip_file_path] + files)
|
subprocess.check_output(['zip', '-r', '-y', zip_file_path] + files)
|
||||||
else:
|
else:
|
||||||
zip_file = zipfile.ZipFile(zip_file_path, "w", zipfile.ZIP_DEFLATED)
|
zip_file = zipfile.ZipFile(zip_file_path, "w", zipfile.ZIP_DEFLATED)
|
||||||
for filename in files:
|
for filename in files:
|
||||||
|
|
Загрузка…
Ссылка в новой задаче