2018-09-28 14:10:42 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
2018-10-13 02:02:52 +00:00
|
|
|
import argparse
|
2018-09-27 05:38:06 +00:00
|
|
|
import glob
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
|
|
|
from lib.config import PLATFORM, get_target_arch
|
|
|
|
from lib.util import scoped_cwd, get_electron_version, make_zip, \
|
2018-09-28 06:48:09 +00:00
|
|
|
get_electron_branding, get_out_dir
|
2018-09-27 05:38:06 +00:00
|
|
|
|
|
|
|
ELECTRON_VERSION = get_electron_version()
|
2018-09-28 06:48:09 +00:00
|
|
|
PROJECT_NAME = get_electron_branding()['project_name']
|
2018-09-27 05:38:06 +00:00
|
|
|
OUT_DIR = get_out_dir()
|
|
|
|
|
|
|
|
def main():
|
2018-10-10 00:04:55 +00:00
|
|
|
print('Zipping Symbols')
|
2018-09-27 05:38:06 +00:00
|
|
|
if get_target_arch() == 'mips64el':
|
|
|
|
return
|
|
|
|
|
2018-10-13 02:02:52 +00:00
|
|
|
args = parse_args()
|
2018-09-27 05:38:06 +00:00
|
|
|
dist_name = 'symbols.zip'
|
2018-10-13 02:02:52 +00:00
|
|
|
zip_file = os.path.join(args.build_dir, dist_name)
|
2018-09-27 05:38:06 +00:00
|
|
|
licenses = ['LICENSE', 'LICENSES.chromium.html', 'version']
|
|
|
|
|
2018-10-13 02:02:52 +00:00
|
|
|
with scoped_cwd(args.build_dir):
|
2018-11-14 20:47:01 +00:00
|
|
|
dirs = ['breakpad_symbols']
|
2018-10-10 00:04:55 +00:00
|
|
|
print('Making symbol zip: ' + zip_file)
|
2018-09-27 05:38:06 +00:00
|
|
|
make_zip(zip_file, licenses, dirs)
|
|
|
|
|
|
|
|
if PLATFORM == 'darwin':
|
|
|
|
dsym_name = 'dsym.zip'
|
2018-10-13 02:02:52 +00:00
|
|
|
with scoped_cwd(args.build_dir):
|
2018-09-27 05:38:06 +00:00
|
|
|
dsyms = glob.glob('*.dSYM')
|
2018-10-13 02:02:52 +00:00
|
|
|
dsym_zip_file = os.path.join(args.build_dir, dsym_name)
|
2018-10-10 00:04:55 +00:00
|
|
|
print('Making dsym zip: ' + dsym_zip_file)
|
|
|
|
make_zip(dsym_zip_file, licenses, dsyms)
|
2018-09-27 05:38:06 +00:00
|
|
|
elif PLATFORM == 'win32':
|
|
|
|
pdb_name = 'pdb.zip'
|
2018-10-13 02:02:52 +00:00
|
|
|
with scoped_cwd(args.build_dir):
|
2018-09-27 05:38:06 +00:00
|
|
|
pdbs = glob.glob('*.pdb')
|
2018-10-13 02:02:52 +00:00
|
|
|
pdb_zip_file = os.path.join(args.build_dir, pdb_name)
|
2018-10-10 00:04:55 +00:00
|
|
|
print('Making pdb zip: ' + pdb_zip_file)
|
|
|
|
make_zip(pdb_zip_file, pdbs + licenses, [])
|
2018-09-27 05:38:06 +00:00
|
|
|
|
2018-10-13 02:02:52 +00:00
|
|
|
def parse_args():
|
|
|
|
parser = argparse.ArgumentParser(description='Zip symbols')
|
|
|
|
parser.add_argument('-b', '--build-dir',
|
|
|
|
help='Path to an Electron build folder.',
|
|
|
|
default=OUT_DIR,
|
|
|
|
required=False)
|
|
|
|
return parser.parse_args()
|
|
|
|
|
2018-09-27 05:38:06 +00:00
|
|
|
if __name__ == '__main__':
|
2018-10-13 02:02:52 +00:00
|
|
|
sys.exit(main())
|