- Notifications
You must be signed in to change notification settings - Fork 16k
/
Copy pathzip-symbols.py
executable file
·71 lines (62 loc) · 2.42 KB
/
zip-symbols.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env python3
from __future__ importprint_function
importargparse
importglob
importos
importsys
fromlib.configimportPLATFORM, get_target_arch
fromlib.utilimportscoped_cwd, get_electron_version, make_zip, \
get_electron_branding, get_out_dir, execute
ELECTRON_VERSION=get_electron_version()
PROJECT_NAME=get_electron_branding()['project_name']
OUT_DIR=get_out_dir()
defmain():
print('Zipping Symbols')
args=parse_args()
dist_name='symbols.zip'
zip_file=os.path.join(args.build_dir, dist_name)
licenses= ['LICENSE', 'LICENSES.chromium.html', 'version']
withscoped_cwd(args.build_dir):
dirs= ['breakpad_symbols']
print('Making symbol zip: '+zip_file)
make_zip(zip_file, licenses, dirs)
ifPLATFORM=='darwin':
dsym_name='dsym.zip'
withscoped_cwd(args.build_dir):
dsyms=glob.glob('*.dSYM')
snapshot_dsyms= ['v8_context_snapshot_generator.dSYM']
fordsyminsnapshot_dsyms:
if (dsymindsyms):
dsyms.remove(dsym)
dsym_zip_file=os.path.join(args.build_dir, dsym_name)
print('Making dsym zip: '+dsym_zip_file)
make_zip(dsym_zip_file, licenses, dsyms)
dsym_snapshot_name='dsym-snapshot.zip'
dsym_snapshot_zip_file=os.path.join(args.build_dir, dsym_snapshot_name)
print('Making dsym snapshot zip: '+dsym_snapshot_zip_file)
make_zip(dsym_snapshot_zip_file, licenses, snapshot_dsyms)
iflen(dsyms) >0and'DELETE_DSYMS_AFTER_ZIP'inos.environ:
execute(['rm', '-rf'] +dsyms)
elifPLATFORM=='win32':
pdb_name='pdb.zip'
withscoped_cwd(args.build_dir):
pdbs=glob.glob('*.pdb')
pdb_zip_file=os.path.join(args.build_dir, pdb_name)
print('Making pdb zip: '+pdb_zip_file)
make_zip(pdb_zip_file, pdbs+licenses, [])
elifPLATFORM=='linux':
debug_name='debug.zip'
withscoped_cwd(args.build_dir):
dirs= ['debug']
debug_zip_file=os.path.join(args.build_dir, debug_name)
print('Making debug zip: '+debug_zip_file)
make_zip(debug_zip_file, licenses, dirs)
defparse_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)
returnparser.parse_args()
if__name__=='__main__':
sys.exit(main())