mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Apply yapf formatting to all Python files (issue #2171)
This commit is contained in:
@ -15,10 +15,12 @@ import sys
|
||||
import tarfile
|
||||
import zipfile
|
||||
|
||||
|
||||
def create_zip_archive(input_dir):
|
||||
""" Creates a zip archive of the specified input directory. """
|
||||
zip_file = input_dir + '.zip'
|
||||
zf = zipfile.ZipFile(zip_file, 'w', zipfile.ZIP_DEFLATED, True)
|
||||
|
||||
def addDir(dir):
|
||||
for f in os.listdir(dir):
|
||||
full_path = os.path.join(dir, f)
|
||||
@ -27,9 +29,11 @@ def create_zip_archive(input_dir):
|
||||
else:
|
||||
zf.write(full_path, os.path.relpath(full_path, \
|
||||
os.path.join(input_dir, os.pardir)))
|
||||
|
||||
addDir(input_dir)
|
||||
zf.close()
|
||||
|
||||
|
||||
def create_tar_archive(input_dir, format):
|
||||
""" Creates a tar archive of the specified input directory. """
|
||||
# Supported formats include "gz" and "bz2".
|
||||
@ -38,6 +42,7 @@ def create_tar_archive(input_dir, format):
|
||||
tf.add(input_dir, arcname=os.path.basename(input_dir))
|
||||
tf.close()
|
||||
|
||||
|
||||
def create_7z_archive(input_dir, format):
|
||||
""" Creates a 7z archive of the specified input directory. """
|
||||
# CEF_COMMAND_7ZIP might be "c:\Program Files (x86)\7Zip\7z.exe" or /usr/bin/7za
|
||||
@ -58,11 +63,13 @@ def create_7z_archive(input_dir, format):
|
||||
zip_input = input_dir
|
||||
|
||||
# Create the compressed archive.
|
||||
run('"%s" a -t%s -y %s %s' % (command, format, zip_file, zip_input), working_dir)
|
||||
run('"%s" a -t%s -y %s %s' % (command, format, zip_file, zip_input),
|
||||
working_dir)
|
||||
|
||||
if not tar_file is None:
|
||||
remove_file(tar_file)
|
||||
|
||||
|
||||
def create_output_dir(name, parent_dir):
|
||||
""" Creates an output directory and adds the path to the archive list. """
|
||||
output_dir = os.path.abspath(os.path.join(parent_dir, name))
|
||||
@ -71,6 +78,7 @@ def create_output_dir(name, parent_dir):
|
||||
archive_dirs.append(output_dir)
|
||||
return output_dir
|
||||
|
||||
|
||||
def get_readme_component(name):
|
||||
""" Loads a README file component. """
|
||||
paths = []
|
||||
@ -88,12 +96,13 @@ def get_readme_component(name):
|
||||
|
||||
# load the file if it exists
|
||||
for path in paths:
|
||||
file = os.path.join(path, 'README.' +name + '.txt')
|
||||
file = os.path.join(path, 'README.' + name + '.txt')
|
||||
if path_exists(file):
|
||||
return read_file(file)
|
||||
|
||||
raise Exception('Readme component not found: ' + name)
|
||||
|
||||
|
||||
def create_readme():
|
||||
""" Creates the README.TXT file. """
|
||||
# gather the components
|
||||
@ -148,6 +157,7 @@ def create_readme():
|
||||
if not options.quiet:
|
||||
sys.stdout.write('Creating README.TXT file.\n')
|
||||
|
||||
|
||||
def create_fuzed_gtest(tests_dir):
|
||||
""" Generate a fuzed version of gtest and build the expected directory structure. """
|
||||
src_gtest_dir = os.path.join(src_dir, 'testing', 'gtest')
|
||||
@ -177,11 +187,14 @@ def create_fuzed_gtest(tests_dir):
|
||||
move_file(gtest_cpp, target_gtest_cpp_dir, options.quiet)
|
||||
|
||||
# gtest LICENSE file at tests/gtest/LICENSE
|
||||
copy_file(os.path.join(src_gtest_dir, 'LICENSE'), target_gtest_dir, options.quiet)
|
||||
copy_file(
|
||||
os.path.join(src_gtest_dir, 'LICENSE'), target_gtest_dir, options.quiet)
|
||||
|
||||
# CEF README file at tests/gtest/README.cef
|
||||
copy_file(os.path.join(cef_dir, 'tests', 'gtest', 'README.cef.in'),
|
||||
os.path.join(target_gtest_dir, 'README.cef'), options.quiet)
|
||||
copy_file(
|
||||
os.path.join(cef_dir, 'tests', 'gtest', 'README.cef.in'),
|
||||
os.path.join(target_gtest_dir, 'README.cef'), options.quiet)
|
||||
|
||||
|
||||
def transfer_gypi_files(src_dir, gypi_paths, gypi_path_prefix, dst_dir, quiet):
|
||||
""" Transfer files from one location to another. """
|
||||
@ -192,7 +205,8 @@ def transfer_gypi_files(src_dir, gypi_paths, gypi_path_prefix, dst_dir, quiet):
|
||||
make_dir(dst_path, quiet)
|
||||
copy_file(src, dst, quiet)
|
||||
|
||||
def normalize_headers(file, new_path = ''):
|
||||
|
||||
def normalize_headers(file, new_path=''):
|
||||
""" Normalize headers post-processing. Remove the path component from any
|
||||
project include directives. """
|
||||
data = read_file(file)
|
||||
@ -200,6 +214,7 @@ def normalize_headers(file, new_path = ''):
|
||||
"// Include path modified for CEF Binary Distribution.\n#include \""+new_path+"\\1\"", data)
|
||||
write_file(file, data)
|
||||
|
||||
|
||||
def eval_transfer_file(cef_dir, script_dir, transfer_cfg, output_dir, quiet):
|
||||
""" Transfer files based on the specified configuration. """
|
||||
if not path_exists(transfer_cfg):
|
||||
@ -219,8 +234,9 @@ def eval_transfer_file(cef_dir, script_dir, transfer_cfg, output_dir, quiet):
|
||||
# place a readme file in the destination directory
|
||||
readme = os.path.join(dst_path, 'README-TRANSFER.txt')
|
||||
if not path_exists(readme):
|
||||
copy_file(os.path.join(script_dir, 'distrib/README-TRANSFER.txt'), readme)
|
||||
open(readme, 'ab').write(cfg['source']+"\n")
|
||||
copy_file(
|
||||
os.path.join(script_dir, 'distrib/README-TRANSFER.txt'), readme)
|
||||
open(readme, 'ab').write(cfg['source'] + "\n")
|
||||
|
||||
# perform any required post-processing
|
||||
if 'post-process' in cfg:
|
||||
@ -231,7 +247,9 @@ def eval_transfer_file(cef_dir, script_dir, transfer_cfg, output_dir, quiet):
|
||||
new_path = cfg['new_header_path']
|
||||
normalize_headers(dst, new_path)
|
||||
|
||||
def transfer_files(cef_dir, script_dir, transfer_cfg_dir, mode, output_dir, quiet):
|
||||
|
||||
def transfer_files(cef_dir, script_dir, transfer_cfg_dir, mode, output_dir,
|
||||
quiet):
|
||||
# Non-mode-specific transfers.
|
||||
transfer_cfg = os.path.join(transfer_cfg_dir, 'transfer.cfg')
|
||||
eval_transfer_file(cef_dir, script_dir, transfer_cfg, output_dir, quiet)
|
||||
@ -239,9 +257,11 @@ def transfer_files(cef_dir, script_dir, transfer_cfg_dir, mode, output_dir, quie
|
||||
transfer_cfg = os.path.join(transfer_cfg_dir, 'transfer_%s.cfg' % mode)
|
||||
eval_transfer_file(cef_dir, script_dir, transfer_cfg, output_dir, quiet)
|
||||
|
||||
|
||||
def combine_libs(build_dir, libs, dest_lib):
|
||||
""" Combine multiple static libraries into a single static library. """
|
||||
cmdline = 'msvs_env.bat win%s python combine_libs.py -o "%s"' % (platform_arch, dest_lib)
|
||||
cmdline = 'msvs_env.bat win%s python combine_libs.py -o "%s"' % (
|
||||
platform_arch, dest_lib)
|
||||
for lib in libs:
|
||||
lib_path = os.path.join(build_dir, lib)
|
||||
for path in get_files(lib_path): # Expand wildcards in |lib_path|.
|
||||
@ -250,13 +270,15 @@ def combine_libs(build_dir, libs, dest_lib):
|
||||
cmdline = cmdline + ' "%s"' % path
|
||||
run(cmdline, os.path.join(cef_dir, 'tools'))
|
||||
|
||||
|
||||
def run(command_line, working_dir):
|
||||
""" Run a command. """
|
||||
sys.stdout.write('-------- Running "'+command_line+'" in "'+\
|
||||
working_dir+'"...'+"\n")
|
||||
args = shlex.split(command_line.replace('\\', '\\\\'))
|
||||
return subprocess.check_call(args, cwd=working_dir, env=os.environ,
|
||||
shell=(sys.platform == 'win32'))
|
||||
return subprocess.check_call(
|
||||
args, cwd=working_dir, env=os.environ, shell=(sys.platform == 'win32'))
|
||||
|
||||
|
||||
# cannot be loaded as a module
|
||||
if __name__ != "__main__":
|
||||
@ -269,45 +291,81 @@ This utility builds the CEF Binary Distribution.
|
||||
"""
|
||||
|
||||
parser = OptionParser(description=disc)
|
||||
parser.add_option('--output-dir', dest='outputdir', metavar='DIR',
|
||||
help='output directory [required]')
|
||||
parser.add_option('--distrib-subdir', dest='distribsubdir',
|
||||
help='name of the subdirectory for the distribution',
|
||||
default='')
|
||||
parser.add_option('--allow-partial',
|
||||
action='store_true', dest='allowpartial', default=False,
|
||||
help='allow creation of partial distributions')
|
||||
parser.add_option('--no-symbols',
|
||||
action='store_true', dest='nosymbols', default=False,
|
||||
help='don\'t create symbol files')
|
||||
parser.add_option('--no-docs',
|
||||
action='store_true', dest='nodocs', default=False,
|
||||
help='don\'t create documentation')
|
||||
parser.add_option('--no-archive',
|
||||
action='store_true', dest='noarchive', default=False,
|
||||
help='don\'t create archives for output directories')
|
||||
parser.add_option('--ninja-build',
|
||||
action='store_true', dest='ninjabuild', default=False,
|
||||
help='build was created using ninja')
|
||||
parser.add_option('--x64-build',
|
||||
action='store_true', dest='x64build', default=False,
|
||||
help='create a 64-bit binary distribution')
|
||||
parser.add_option('--arm-build',
|
||||
action='store_true', dest='armbuild', default=False,
|
||||
help='create an ARM binary distribution')
|
||||
parser.add_option('--minimal',
|
||||
action='store_true', dest='minimal', default=False,
|
||||
help='include only release build binary files')
|
||||
parser.add_option('--client',
|
||||
action='store_true', dest='client', default=False,
|
||||
help='include only the sample application')
|
||||
parser.add_option('-q', '--quiet',
|
||||
action='store_true', dest='quiet', default=False,
|
||||
help='do not output detailed status information')
|
||||
parser.add_option(
|
||||
'--output-dir',
|
||||
dest='outputdir',
|
||||
metavar='DIR',
|
||||
help='output directory [required]')
|
||||
parser.add_option(
|
||||
'--distrib-subdir',
|
||||
dest='distribsubdir',
|
||||
help='name of the subdirectory for the distribution',
|
||||
default='')
|
||||
parser.add_option(
|
||||
'--allow-partial',
|
||||
action='store_true',
|
||||
dest='allowpartial',
|
||||
default=False,
|
||||
help='allow creation of partial distributions')
|
||||
parser.add_option(
|
||||
'--no-symbols',
|
||||
action='store_true',
|
||||
dest='nosymbols',
|
||||
default=False,
|
||||
help='don\'t create symbol files')
|
||||
parser.add_option(
|
||||
'--no-docs',
|
||||
action='store_true',
|
||||
dest='nodocs',
|
||||
default=False,
|
||||
help='don\'t create documentation')
|
||||
parser.add_option(
|
||||
'--no-archive',
|
||||
action='store_true',
|
||||
dest='noarchive',
|
||||
default=False,
|
||||
help='don\'t create archives for output directories')
|
||||
parser.add_option(
|
||||
'--ninja-build',
|
||||
action='store_true',
|
||||
dest='ninjabuild',
|
||||
default=False,
|
||||
help='build was created using ninja')
|
||||
parser.add_option(
|
||||
'--x64-build',
|
||||
action='store_true',
|
||||
dest='x64build',
|
||||
default=False,
|
||||
help='create a 64-bit binary distribution')
|
||||
parser.add_option(
|
||||
'--arm-build',
|
||||
action='store_true',
|
||||
dest='armbuild',
|
||||
default=False,
|
||||
help='create an ARM binary distribution')
|
||||
parser.add_option(
|
||||
'--minimal',
|
||||
action='store_true',
|
||||
dest='minimal',
|
||||
default=False,
|
||||
help='include only release build binary files')
|
||||
parser.add_option(
|
||||
'--client',
|
||||
action='store_true',
|
||||
dest='client',
|
||||
default=False,
|
||||
help='include only the sample application')
|
||||
parser.add_option(
|
||||
'-q',
|
||||
'--quiet',
|
||||
action='store_true',
|
||||
dest='quiet',
|
||||
default=False,
|
||||
help='do not output detailed status information')
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
# Test the operating system.
|
||||
platform = '';
|
||||
platform = ''
|
||||
if sys.platform == 'win32':
|
||||
platform = 'windows'
|
||||
elif sys.platform == 'darwin':
|
||||
@ -369,8 +427,9 @@ args = {}
|
||||
read_version_file(os.path.join(cef_dir, 'VERSION'), args)
|
||||
read_version_file(os.path.join(cef_dir, '../chrome/VERSION'), args)
|
||||
|
||||
cef_ver = '%s.%s.%s.g%s' % (args['CEF_MAJOR'], args['BUILD'], cef_commit_number, cef_rev[:7])
|
||||
chromium_ver = args['MAJOR']+'.'+args['MINOR']+'.'+args['BUILD']+'.'+args['PATCH']
|
||||
cef_ver = '%s.%s.%s.g%s' % (args['CEF_MAJOR'], args['BUILD'], cef_commit_number,
|
||||
cef_rev[:7])
|
||||
chromium_ver = args['MAJOR'] + '.' + args['MINOR'] + '.' + args['BUILD'] + '.' + args['PATCH']
|
||||
|
||||
# list of output directories to be archived
|
||||
archive_dirs = []
|
||||
@ -456,8 +515,8 @@ if mode == 'standard' or mode == 'minimal':
|
||||
|
||||
# Transfer generated include files.
|
||||
generated_includes = [
|
||||
'cef_pack_resources.h',
|
||||
'cef_pack_strings.h',
|
||||
'cef_pack_resources.h',
|
||||
'cef_pack_strings.h',
|
||||
]
|
||||
for include in generated_includes:
|
||||
# Debug and Release build should be the same so grab whichever exists.
|
||||
@ -586,12 +645,12 @@ if platform == 'windows':
|
||||
|
||||
libcef_dll_file = 'libcef.dll.lib'
|
||||
sandbox_libs = [
|
||||
'obj\\base\\allocator\\unified_allocator_shim\\*.obj',
|
||||
'obj\\base\\base.lib',
|
||||
'obj\\base\\base_static.lib',
|
||||
'obj\\base\\third_party\\dynamic_annotations\\dynamic_annotations.lib',
|
||||
'obj\\cef\\cef_sandbox.lib',
|
||||
'obj\\sandbox\\win\\sandbox.lib',
|
||||
'obj\\base\\allocator\\unified_allocator_shim\\*.obj',
|
||||
'obj\\base\\base.lib',
|
||||
'obj\\base\\base_static.lib',
|
||||
'obj\\base\\third_party\\dynamic_annotations\\dynamic_annotations.lib',
|
||||
'obj\\cef\\cef_sandbox.lib',
|
||||
'obj\\sandbox\\win\\sandbox.lib',
|
||||
]
|
||||
|
||||
valid_build_dir = None
|
||||
@ -599,47 +658,64 @@ if platform == 'windows':
|
||||
if mode == 'standard':
|
||||
# transfer Debug files
|
||||
build_dir = build_dir_debug
|
||||
if not options.allowpartial or path_exists(os.path.join(build_dir, 'libcef.dll')):
|
||||
if not options.allowpartial or path_exists(
|
||||
os.path.join(build_dir, 'libcef.dll')):
|
||||
valid_build_dir = build_dir
|
||||
dst_dir = os.path.join(output_dir, 'Debug')
|
||||
make_dir(dst_dir, options.quiet)
|
||||
copy_files(os.path.join(script_dir, 'distrib/win/*.dll'), dst_dir, options.quiet)
|
||||
copy_files(
|
||||
os.path.join(script_dir, 'distrib/win/*.dll'), dst_dir, options.quiet)
|
||||
for binary in binaries:
|
||||
copy_file(os.path.join(build_dir, binary), os.path.join(dst_dir, os.path.basename(binary)), options.quiet)
|
||||
copy_file(
|
||||
os.path.join(build_dir, binary),
|
||||
os.path.join(dst_dir, os.path.basename(binary)), options.quiet)
|
||||
copy_file(os.path.join(build_dir, libcef_dll_file), os.path.join(dst_dir, 'libcef.lib'), \
|
||||
options.quiet)
|
||||
combine_libs(build_dir, sandbox_libs, os.path.join(dst_dir, 'cef_sandbox.lib'));
|
||||
combine_libs(build_dir, sandbox_libs,
|
||||
os.path.join(dst_dir, 'cef_sandbox.lib'))
|
||||
|
||||
if not options.nosymbols:
|
||||
# create the symbol output directory
|
||||
symbol_output_dir = create_output_dir(output_dir_name + '_debug_symbols', options.outputdir)
|
||||
symbol_output_dir = create_output_dir(
|
||||
output_dir_name + '_debug_symbols', options.outputdir)
|
||||
# transfer contents
|
||||
copy_file(os.path.join(build_dir, 'libcef.dll.pdb'), symbol_output_dir, options.quiet)
|
||||
copy_file(
|
||||
os.path.join(build_dir, 'libcef.dll.pdb'), symbol_output_dir,
|
||||
options.quiet)
|
||||
else:
|
||||
sys.stderr.write("No Debug build files.\n")
|
||||
|
||||
# transfer Release files
|
||||
build_dir = build_dir_release
|
||||
if not options.allowpartial or path_exists(os.path.join(build_dir, 'libcef.dll')):
|
||||
if not options.allowpartial or path_exists(
|
||||
os.path.join(build_dir, 'libcef.dll')):
|
||||
valid_build_dir = build_dir
|
||||
dst_dir = os.path.join(output_dir, 'Release')
|
||||
make_dir(dst_dir, options.quiet)
|
||||
copy_files(os.path.join(script_dir, 'distrib/win/*.dll'), dst_dir, options.quiet)
|
||||
copy_files(
|
||||
os.path.join(script_dir, 'distrib/win/*.dll'), dst_dir, options.quiet)
|
||||
for binary in binaries:
|
||||
copy_file(os.path.join(build_dir, binary), os.path.join(dst_dir, os.path.basename(binary)), options.quiet)
|
||||
copy_file(
|
||||
os.path.join(build_dir, binary),
|
||||
os.path.join(dst_dir, os.path.basename(binary)), options.quiet)
|
||||
|
||||
if mode != 'client':
|
||||
copy_file(os.path.join(build_dir, libcef_dll_file), os.path.join(dst_dir, 'libcef.lib'), \
|
||||
options.quiet)
|
||||
combine_libs(build_dir, sandbox_libs, os.path.join(dst_dir, 'cef_sandbox.lib'));
|
||||
combine_libs(build_dir, sandbox_libs,
|
||||
os.path.join(dst_dir, 'cef_sandbox.lib'))
|
||||
else:
|
||||
copy_file(os.path.join(build_dir, 'cefclient.exe'), dst_dir, options.quiet)
|
||||
copy_file(
|
||||
os.path.join(build_dir, 'cefclient.exe'), dst_dir, options.quiet)
|
||||
|
||||
if not options.nosymbols:
|
||||
# create the symbol output directory
|
||||
symbol_output_dir = create_output_dir(output_dir_name + '_release_symbols', options.outputdir)
|
||||
symbol_output_dir = create_output_dir(
|
||||
output_dir_name + '_release_symbols', options.outputdir)
|
||||
# transfer contents
|
||||
copy_file(os.path.join(build_dir, 'libcef.dll.pdb'), symbol_output_dir, options.quiet)
|
||||
copy_file(
|
||||
os.path.join(build_dir, 'libcef.dll.pdb'), symbol_output_dir,
|
||||
options.quiet)
|
||||
else:
|
||||
sys.stderr.write("No Release build files.\n")
|
||||
|
||||
@ -652,12 +728,19 @@ if platform == 'windows':
|
||||
dst_dir = os.path.join(output_dir, 'Resources')
|
||||
make_dir(dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'cef.pak'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'cef_100_percent.pak'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'cef_200_percent.pak'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'cef_extensions.pak'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'devtools_resources.pak'), dst_dir, options.quiet)
|
||||
copy_file(
|
||||
os.path.join(build_dir, 'cef_100_percent.pak'), dst_dir, options.quiet)
|
||||
copy_file(
|
||||
os.path.join(build_dir, 'cef_200_percent.pak'), dst_dir, options.quiet)
|
||||
copy_file(
|
||||
os.path.join(build_dir, 'cef_extensions.pak'), dst_dir, options.quiet)
|
||||
copy_file(
|
||||
os.path.join(build_dir, 'devtools_resources.pak'), dst_dir,
|
||||
options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'icudtl.dat'), dst_dir, options.quiet)
|
||||
copy_dir(os.path.join(build_dir, 'locales'), os.path.join(dst_dir, 'locales'), options.quiet)
|
||||
copy_dir(
|
||||
os.path.join(build_dir, 'locales'),
|
||||
os.path.join(dst_dir, 'locales'), options.quiet)
|
||||
|
||||
if mode == 'standard' or mode == 'minimal':
|
||||
# transfer include files
|
||||
@ -689,12 +772,13 @@ if platform == 'windows':
|
||||
|
||||
if not options.nodocs:
|
||||
# generate doc files
|
||||
os.popen('make_cppdocs.bat '+cef_rev)
|
||||
os.popen('make_cppdocs.bat ' + cef_rev)
|
||||
|
||||
src_dir = os.path.join(cef_dir, 'docs')
|
||||
if path_exists(src_dir):
|
||||
# create the docs output directory
|
||||
docs_output_dir = create_output_dir(output_dir_base + '_docs', options.outputdir)
|
||||
docs_output_dir = create_output_dir(output_dir_base + '_docs',
|
||||
options.outputdir)
|
||||
# transfer contents
|
||||
copy_dir(src_dir, docs_output_dir, options.quiet)
|
||||
|
||||
@ -705,46 +789,60 @@ elif platform == 'macosx':
|
||||
if mode == 'standard':
|
||||
# transfer Debug files
|
||||
build_dir = build_dir_debug
|
||||
if not options.allowpartial or path_exists(os.path.join(build_dir, 'cefclient.app')):
|
||||
if not options.allowpartial or path_exists(
|
||||
os.path.join(build_dir, 'cefclient.app')):
|
||||
valid_build_dir = build_dir
|
||||
dst_dir = os.path.join(output_dir, 'Debug')
|
||||
make_dir(dst_dir, options.quiet)
|
||||
copy_dir(os.path.join(build_dir, 'cefclient.app/Contents/Frameworks/%s.framework' % framework_name), \
|
||||
os.path.join(dst_dir, '%s.framework' % framework_name), options.quiet)
|
||||
copy_file(os.path.join(script_dir, 'distrib/mac/widevinecdmadapter.plugin'), dst_dir, options.quiet)
|
||||
copy_file(
|
||||
os.path.join(script_dir, 'distrib/mac/widevinecdmadapter.plugin'),
|
||||
dst_dir, options.quiet)
|
||||
|
||||
if not options.nosymbols:
|
||||
# create the symbol output directory
|
||||
symbol_output_dir = create_output_dir(output_dir_name + '_debug_symbols', options.outputdir)
|
||||
symbol_output_dir = create_output_dir(
|
||||
output_dir_name + '_debug_symbols', options.outputdir)
|
||||
|
||||
# The real dSYM already exists, just copy it to the output directory.
|
||||
# dSYMs are only generated when is_official_build=true or enable_dsyms=true.
|
||||
# See //build/config/mac/symbols.gni.
|
||||
copy_dir(os.path.join(build_dir, '%s.dSYM' % framework_name),
|
||||
os.path.join(symbol_output_dir, '%s.dSYM' % framework_name), options.quiet)
|
||||
copy_dir(
|
||||
os.path.join(build_dir, '%s.dSYM' % framework_name),
|
||||
os.path.join(symbol_output_dir, '%s.dSYM' % framework_name),
|
||||
options.quiet)
|
||||
|
||||
# transfer Release files
|
||||
build_dir = build_dir_release
|
||||
if not options.allowpartial or path_exists(os.path.join(build_dir, 'cefclient.app')):
|
||||
if not options.allowpartial or path_exists(
|
||||
os.path.join(build_dir, 'cefclient.app')):
|
||||
valid_build_dir = build_dir
|
||||
dst_dir = os.path.join(output_dir, 'Release')
|
||||
make_dir(dst_dir, options.quiet)
|
||||
if mode != 'client':
|
||||
copy_dir(os.path.join(build_dir, 'cefclient.app/Contents/Frameworks/%s.framework' % framework_name), \
|
||||
os.path.join(dst_dir, '%s.framework' % framework_name), options.quiet)
|
||||
copy_file(os.path.join(script_dir, 'distrib/mac/widevinecdmadapter.plugin'), dst_dir, options.quiet)
|
||||
copy_file(
|
||||
os.path.join(script_dir, 'distrib/mac/widevinecdmadapter.plugin'),
|
||||
dst_dir, options.quiet)
|
||||
else:
|
||||
copy_dir(os.path.join(build_dir, 'cefclient.app'), os.path.join(dst_dir, 'cefclient.app'), options.quiet)
|
||||
copy_dir(
|
||||
os.path.join(build_dir, 'cefclient.app'),
|
||||
os.path.join(dst_dir, 'cefclient.app'), options.quiet)
|
||||
|
||||
if not options.nosymbols:
|
||||
# create the symbol output directory
|
||||
symbol_output_dir = create_output_dir(output_dir_name + '_release_symbols', options.outputdir)
|
||||
symbol_output_dir = create_output_dir(
|
||||
output_dir_name + '_release_symbols', options.outputdir)
|
||||
|
||||
# The real dSYM already exists, just copy it to the output directory.
|
||||
# dSYMs are only generated when is_official_build=true or enable_dsyms=true.
|
||||
# See //build/config/mac/symbols.gni.
|
||||
copy_dir(os.path.join(build_dir, '%s.dSYM' % framework_name),
|
||||
os.path.join(symbol_output_dir, '%s.dSYM' % framework_name), options.quiet)
|
||||
copy_dir(
|
||||
os.path.join(build_dir, '%s.dSYM' % framework_name),
|
||||
os.path.join(symbol_output_dir, '%s.dSYM' % framework_name),
|
||||
options.quiet)
|
||||
|
||||
if mode == 'standard' or mode == 'minimal':
|
||||
# transfer include files
|
||||
@ -804,11 +902,17 @@ elif platform == 'linux':
|
||||
valid_build_dir = build_dir
|
||||
dst_dir = os.path.join(output_dir, 'Debug')
|
||||
make_dir(dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'chrome_sandbox'), os.path.join(dst_dir, 'chrome-sandbox'), options.quiet)
|
||||
copy_file(
|
||||
os.path.join(build_dir, 'chrome_sandbox'),
|
||||
os.path.join(dst_dir, 'chrome-sandbox'), options.quiet)
|
||||
copy_file(libcef_path, dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'libwidevinecdmadapter.so'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'natives_blob.bin'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'snapshot_blob.bin'), dst_dir, options.quiet)
|
||||
copy_file(
|
||||
os.path.join(build_dir, 'libwidevinecdmadapter.so'), dst_dir,
|
||||
options.quiet)
|
||||
copy_file(
|
||||
os.path.join(build_dir, 'natives_blob.bin'), dst_dir, options.quiet)
|
||||
copy_file(
|
||||
os.path.join(build_dir, 'snapshot_blob.bin'), dst_dir, options.quiet)
|
||||
else:
|
||||
sys.stderr.write("No Debug build files.\n")
|
||||
|
||||
@ -823,10 +927,16 @@ elif platform == 'linux':
|
||||
if mode == 'client':
|
||||
copy_file(os.path.join(build_dir, 'cefsimple'), dst_dir, options.quiet)
|
||||
copy_file(libcef_path, dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'chrome_sandbox'), os.path.join(dst_dir, 'chrome-sandbox'), options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'libwidevinecdmadapter.so'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'natives_blob.bin'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'snapshot_blob.bin'), dst_dir, options.quiet)
|
||||
copy_file(
|
||||
os.path.join(build_dir, 'chrome_sandbox'),
|
||||
os.path.join(dst_dir, 'chrome-sandbox'), options.quiet)
|
||||
copy_file(
|
||||
os.path.join(build_dir, 'libwidevinecdmadapter.so'), dst_dir,
|
||||
options.quiet)
|
||||
copy_file(
|
||||
os.path.join(build_dir, 'natives_blob.bin'), dst_dir, options.quiet)
|
||||
copy_file(
|
||||
os.path.join(build_dir, 'snapshot_blob.bin'), dst_dir, options.quiet)
|
||||
else:
|
||||
sys.stderr.write("No Release build files.\n")
|
||||
|
||||
@ -839,12 +949,19 @@ elif platform == 'linux':
|
||||
dst_dir = os.path.join(output_dir, 'Resources')
|
||||
make_dir(dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'cef.pak'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'cef_100_percent.pak'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'cef_200_percent.pak'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'cef_extensions.pak'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'devtools_resources.pak'), dst_dir, options.quiet)
|
||||
copy_file(
|
||||
os.path.join(build_dir, 'cef_100_percent.pak'), dst_dir, options.quiet)
|
||||
copy_file(
|
||||
os.path.join(build_dir, 'cef_200_percent.pak'), dst_dir, options.quiet)
|
||||
copy_file(
|
||||
os.path.join(build_dir, 'cef_extensions.pak'), dst_dir, options.quiet)
|
||||
copy_file(
|
||||
os.path.join(build_dir, 'devtools_resources.pak'), dst_dir,
|
||||
options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'icudtl.dat'), dst_dir, options.quiet)
|
||||
copy_dir(os.path.join(build_dir, 'locales'), os.path.join(dst_dir, 'locales'), options.quiet)
|
||||
copy_dir(
|
||||
os.path.join(build_dir, 'locales'),
|
||||
os.path.join(dst_dir, 'locales'), options.quiet)
|
||||
|
||||
if mode == 'standard' or mode == 'minimal':
|
||||
# transfer include files
|
||||
@ -885,7 +1002,8 @@ if not options.noarchive:
|
||||
|
||||
for dir in archive_dirs:
|
||||
if not options.quiet:
|
||||
sys.stdout.write("Creating %s archive for %s...\n" % (archive_format, os.path.basename(dir)))
|
||||
sys.stdout.write("Creating %s archive for %s...\n" %
|
||||
(archive_format, os.path.basename(dir)))
|
||||
if archive_format == 'zip':
|
||||
create_zip_archive(dir)
|
||||
elif archive_format == 'tar.gz':
|
||||
|
Reference in New Issue
Block a user