mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Merge revision 1203 changes:
- Fix ninja build on all platforms (issue #922). - Update make_distrib.py to support ninja builds via a new "ninja-build" flag (issue #922). - Improvements to automate.py: -- Allow specification of the depot_tools directory via a "depot-tools" flag (issue #592). -- Add ninja build support via a "ninja-build" flag (issue #922). -- Allow relative paths for download directories (issue #942). -- Add the ability to print commands without executing them via a "dry-run" flag. -- Specifying the "force-clean" flag will also remove the build output directory. -- Add support for a minimal distribution mode where only release binaries and resources are packaged. git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/1453@1204 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -101,6 +101,7 @@ def transfer_files(cef_dir, script_dir, transfer_cfg, output_dir, quiet):
|
||||
def generate_msvs_projects(version):
|
||||
""" Generate MSVS projects for the specified version. """
|
||||
sys.stdout.write('Generating '+version+' project files...')
|
||||
os.environ['GYP_GENERATORS'] = 'msvs'
|
||||
os.environ['GYP_MSVS_VERSION'] = version
|
||||
gyper = [ 'python', 'tools/gyp_cef', os.path.relpath(os.path.join(output_dir, 'cefclient.gyp'), cef_dir) ]
|
||||
RunAction(cef_dir, gyper);
|
||||
@ -120,6 +121,24 @@ def fix_msvs_projects():
|
||||
data = data.replace('..\\..\\..\\build\\', '')
|
||||
write_file(file, data)
|
||||
|
||||
def fix_make_projects():
|
||||
""" Fix the output directory path in Makefile all .mk files. """
|
||||
find = os.path.relpath(output_dir, src_dir)
|
||||
files = [os.path.join(output_dir, 'Makefile')]
|
||||
for file in get_files(os.path.join(output_dir, '*.mk')):
|
||||
files.append(file)
|
||||
for file in files:
|
||||
data = read_file(file)
|
||||
data = data.replace(find, '.')
|
||||
if os.path.basename(file) == 'Makefile':
|
||||
# remove the quiet_cmd_regen_makefile section
|
||||
pos = str.find(data, 'quiet_cmd_regen_makefile')
|
||||
if pos >= 0:
|
||||
epos = str.find(data, '#', pos)
|
||||
if epos >= 0:
|
||||
data = data[0:pos] + data[epos:]
|
||||
write_file(file, data)
|
||||
|
||||
def run(command_line, working_dir):
|
||||
""" Run a command. """
|
||||
sys.stdout.write('-------- Running "'+command_line+'" in "'+\
|
||||
@ -144,6 +163,15 @@ parser.add_option('--output-dir', dest='outputdir', metavar='DIR',
|
||||
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='do not create symbol files')
|
||||
parser.add_option('--ninja-build',
|
||||
action='store_true', dest='ninjabuild', default=False,
|
||||
help='build was created using ninja')
|
||||
parser.add_option('--minimal',
|
||||
action='store_true', dest='minimal', default=False,
|
||||
help='include only release build binary files')
|
||||
parser.add_option('-q', '--quiet',
|
||||
action='store_true', dest='quiet', default=False,
|
||||
help='do not output detailed status information')
|
||||
@ -160,6 +188,9 @@ script_dir = os.path.dirname(__file__)
|
||||
# CEF root directory
|
||||
cef_dir = os.path.abspath(os.path.join(script_dir, os.pardir))
|
||||
|
||||
# src directory
|
||||
src_dir = os.path.abspath(os.path.join(cef_dir, os.pardir))
|
||||
|
||||
# retrieve url, revision and date information
|
||||
cef_info = get_svn_info(cef_dir)
|
||||
cef_url = cef_info['url']
|
||||
@ -170,15 +201,12 @@ chromium_rev = chromium_info['revision']
|
||||
date = get_date()
|
||||
|
||||
# Read and parse the version file (key=value pairs, one per line)
|
||||
chrome = {}
|
||||
lines = read_file(os.path.join(cef_dir, '../chrome/VERSION')).split("\n")
|
||||
for line in lines:
|
||||
parts = line.split('=', 1)
|
||||
if len(parts) == 2:
|
||||
chrome[parts[0]] = parts[1]
|
||||
args = {}
|
||||
read_version_file(os.path.join(cef_dir, 'VERSION'), args)
|
||||
read_version_file(os.path.join(cef_dir, '../chrome/VERSION'), args)
|
||||
|
||||
cef_ver = '1.'+chrome['BUILD']+'.'+cef_rev
|
||||
chromium_ver = chrome['MAJOR']+'.'+chrome['MINOR']+'.'+chrome['BUILD']+'.'+chrome['PATCH']
|
||||
cef_ver = args['CEF_MAJOR']+'.'+args['BUILD']+'.'+cef_rev
|
||||
chromium_ver = args['MAJOR']+'.'+args['MINOR']+'.'+args['BUILD']+'.'+args['PATCH']
|
||||
|
||||
# Test the operating system.
|
||||
platform = '';
|
||||
@ -190,16 +218,19 @@ elif sys.platform.startswith('linux'):
|
||||
platform = 'linux'
|
||||
|
||||
# output directory
|
||||
output_dir = os.path.abspath(os.path.join(options.outputdir, \
|
||||
'cef_binary_'+cef_ver+'_'+platform))
|
||||
output_dir_name = 'cef_binary_'+cef_ver+'_'+platform
|
||||
if options.minimal:
|
||||
output_dir_name = output_dir_name + '_minimal'
|
||||
output_dir = os.path.abspath(os.path.join(options.outputdir, output_dir_name))
|
||||
remove_dir(output_dir, options.quiet)
|
||||
make_dir(output_dir, options.quiet)
|
||||
|
||||
# symbol directory
|
||||
symbol_dir = os.path.abspath(os.path.join(options.outputdir, \
|
||||
'cef_binary_'+cef_ver+'_'+platform+'_symbols'))
|
||||
remove_dir(symbol_dir, options.quiet)
|
||||
make_dir(symbol_dir, options.quiet)
|
||||
if not options.nosymbols:
|
||||
# symbol directory
|
||||
symbol_dir_name = output_dir_name + '_symbols'
|
||||
symbol_dir = os.path.abspath(os.path.join(options.outputdir, symbol_dir_name))
|
||||
remove_dir(symbol_dir, options.quiet)
|
||||
make_dir(symbol_dir, options.quiet)
|
||||
|
||||
# transfer the LICENSE.txt file
|
||||
copy_file(os.path.join(cef_dir, 'LICENSE.txt'), output_dir, options.quiet)
|
||||
@ -212,245 +243,317 @@ cef_paths = cef_paths['variables']
|
||||
cef_paths2 = eval_file(os.path.join(cef_dir, 'cef_paths2.gypi'))
|
||||
cef_paths2 = cef_paths2['variables']
|
||||
|
||||
# create the include directory
|
||||
include_dir = os.path.join(output_dir, 'include')
|
||||
make_dir(include_dir, options.quiet)
|
||||
if not options.minimal:
|
||||
# create the include directory
|
||||
include_dir = os.path.join(output_dir, 'include')
|
||||
make_dir(include_dir, options.quiet)
|
||||
|
||||
# create the cefclient directory
|
||||
cefclient_dir = os.path.join(output_dir, 'cefclient')
|
||||
make_dir(cefclient_dir, options.quiet)
|
||||
# create the cefclient directory
|
||||
cefclient_dir = os.path.join(output_dir, 'cefclient')
|
||||
make_dir(cefclient_dir, options.quiet)
|
||||
|
||||
# create the libcef_dll_wrapper directory
|
||||
wrapper_dir = os.path.join(output_dir, 'libcef_dll')
|
||||
make_dir(wrapper_dir, options.quiet)
|
||||
# create the libcef_dll_wrapper directory
|
||||
wrapper_dir = os.path.join(output_dir, 'libcef_dll')
|
||||
make_dir(wrapper_dir, options.quiet)
|
||||
|
||||
# transfer common include files
|
||||
transfer_gypi_files(cef_dir, cef_paths2['includes_common'], \
|
||||
'include/', include_dir, options.quiet)
|
||||
transfer_gypi_files(cef_dir, cef_paths2['includes_capi'], \
|
||||
'include/', include_dir, options.quiet)
|
||||
transfer_gypi_files(cef_dir, cef_paths2['includes_wrapper'], \
|
||||
'include/', include_dir, options.quiet)
|
||||
transfer_gypi_files(cef_dir, cef_paths['autogen_cpp_includes'], \
|
||||
'include/', include_dir, options.quiet)
|
||||
transfer_gypi_files(cef_dir, cef_paths['autogen_capi_includes'], \
|
||||
'include/', include_dir, options.quiet)
|
||||
# transfer common include files
|
||||
transfer_gypi_files(cef_dir, cef_paths2['includes_common'], \
|
||||
'include/', include_dir, options.quiet)
|
||||
transfer_gypi_files(cef_dir, cef_paths2['includes_capi'], \
|
||||
'include/', include_dir, options.quiet)
|
||||
transfer_gypi_files(cef_dir, cef_paths2['includes_wrapper'], \
|
||||
'include/', include_dir, options.quiet)
|
||||
transfer_gypi_files(cef_dir, cef_paths['autogen_cpp_includes'], \
|
||||
'include/', include_dir, options.quiet)
|
||||
transfer_gypi_files(cef_dir, cef_paths['autogen_capi_includes'], \
|
||||
'include/', include_dir, options.quiet)
|
||||
|
||||
# transfer common cefclient files
|
||||
transfer_gypi_files(cef_dir, cef_paths2['cefclient_sources_common'], \
|
||||
'tests/cefclient/', cefclient_dir, options.quiet)
|
||||
# transfer common cefclient files
|
||||
transfer_gypi_files(cef_dir, cef_paths2['cefclient_sources_common'], \
|
||||
'tests/cefclient/', cefclient_dir, options.quiet)
|
||||
transfer_gypi_files(cef_dir, cef_paths2['cefclient_bundle_resources_common'], \
|
||||
'tests/cefclient/', cefclient_dir, options.quiet)
|
||||
|
||||
# transfer common libcef_dll_wrapper files
|
||||
transfer_gypi_files(cef_dir, cef_paths2['libcef_dll_wrapper_sources_common'], \
|
||||
'libcef_dll/', wrapper_dir, options.quiet)
|
||||
transfer_gypi_files(cef_dir, cef_paths['autogen_client_side'], \
|
||||
'libcef_dll/', wrapper_dir, options.quiet)
|
||||
# transfer common libcef_dll_wrapper files
|
||||
transfer_gypi_files(cef_dir, cef_paths2['libcef_dll_wrapper_sources_common'], \
|
||||
'libcef_dll/', wrapper_dir, options.quiet)
|
||||
transfer_gypi_files(cef_dir, cef_paths['autogen_client_side'], \
|
||||
'libcef_dll/', wrapper_dir, options.quiet)
|
||||
|
||||
# transfer gyp files
|
||||
copy_file(os.path.join(script_dir, 'distrib/cefclient.gyp'), output_dir, options.quiet)
|
||||
paths_gypi = os.path.join(cef_dir, 'cef_paths2.gypi')
|
||||
data = read_file(paths_gypi)
|
||||
data = data.replace('tests/cefclient/', 'cefclient/')
|
||||
write_file(os.path.join(output_dir, 'cef_paths2.gypi'), data)
|
||||
copy_file(os.path.join(cef_dir, 'cef_paths.gypi'), \
|
||||
os.path.join(output_dir, 'cef_paths.gypi'), options.quiet)
|
||||
# transfer gyp files
|
||||
copy_file(os.path.join(script_dir, 'distrib/cefclient.gyp'), output_dir, options.quiet)
|
||||
paths_gypi = os.path.join(cef_dir, 'cef_paths2.gypi')
|
||||
data = read_file(paths_gypi)
|
||||
data = data.replace('tests/cefclient/', 'cefclient/')
|
||||
write_file(os.path.join(output_dir, 'cef_paths2.gypi'), data)
|
||||
copy_file(os.path.join(cef_dir, 'cef_paths.gypi'), \
|
||||
os.path.join(output_dir, 'cef_paths.gypi'), options.quiet)
|
||||
|
||||
# transfer additional files
|
||||
transfer_files(cef_dir, script_dir, os.path.join(script_dir, 'distrib/transfer.cfg'), \
|
||||
output_dir, options.quiet)
|
||||
# transfer additional files
|
||||
transfer_files(cef_dir, script_dir, os.path.join(script_dir, 'distrib/transfer.cfg'), \
|
||||
output_dir, options.quiet)
|
||||
|
||||
if platform == 'windows':
|
||||
# create the README.TXT file
|
||||
create_readme(os.path.join(script_dir, 'distrib/win/README.txt'), output_dir, cef_url, \
|
||||
cef_rev, cef_ver, chromium_url, chromium_rev, chromium_ver, date)
|
||||
|
||||
# transfer include files
|
||||
transfer_gypi_files(cef_dir, cef_paths2['includes_win'], \
|
||||
'include/', include_dir, options.quiet)
|
||||
if not options.minimal:
|
||||
# transfer include files
|
||||
transfer_gypi_files(cef_dir, cef_paths2['includes_win'], \
|
||||
'include/', include_dir, options.quiet)
|
||||
|
||||
# transfer cefclient files
|
||||
transfer_gypi_files(cef_dir, cef_paths2['cefclient_sources_win'], \
|
||||
'tests/cefclient/', cefclient_dir, options.quiet)
|
||||
# transfer cefclient files
|
||||
transfer_gypi_files(cef_dir, cef_paths2['cefclient_sources_win'], \
|
||||
'tests/cefclient/', cefclient_dir, options.quiet)
|
||||
|
||||
# transfer build/Debug files
|
||||
if not options.allowpartial or path_exists(os.path.join(cef_dir, 'Debug')):
|
||||
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_file(os.path.join(cef_dir, 'Debug/cefclient.exe'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(cef_dir, 'Debug/devtools_resources.pak'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(cef_dir, 'Debug/icudt.dll'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(cef_dir, 'Debug/libcef.dll'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(cef_dir, 'Debug/libEGL.dll'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(cef_dir, 'Debug/libGLESv2.dll'), dst_dir, options.quiet)
|
||||
copy_dir(os.path.join(cef_dir, 'Debug/locales'), os.path.join(dst_dir, 'locales'), \
|
||||
options.quiet)
|
||||
|
||||
# transfer lib/Debug files
|
||||
dst_dir = os.path.join(output_dir, 'lib/Debug')
|
||||
make_dir(dst_dir, options.quiet)
|
||||
copy_file(os.path.join(cef_dir, 'Debug/lib/libcef.lib'), dst_dir, options.quiet)
|
||||
if options.ninjabuild:
|
||||
out_dir = os.path.join(src_dir, 'out')
|
||||
libcef_dll_file = 'libcef.dll.lib'
|
||||
else:
|
||||
sys.stderr.write("No Debug build files.\n")
|
||||
out_dir = cef_dir
|
||||
libcef_dll_file = 'lib/libcef.lib'
|
||||
|
||||
if not options.minimal:
|
||||
# transfer build/Debug files
|
||||
build_dir = os.path.join(out_dir, 'Debug');
|
||||
if not options.allowpartial or path_exists(os.path.join(build_dir, 'cefclient.exe')):
|
||||
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(build_dir, '*.dll'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'cefclient.exe'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'devtools_resources.pak'), dst_dir, options.quiet)
|
||||
copy_dir(os.path.join(build_dir, 'locales'), os.path.join(dst_dir, 'locales'), \
|
||||
options.quiet)
|
||||
|
||||
# transfer lib/Debug files
|
||||
dst_dir = os.path.join(output_dir, 'lib/Debug')
|
||||
make_dir(dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, libcef_dll_file), os.path.join(dst_dir, 'libcef.lib'), \
|
||||
options.quiet)
|
||||
else:
|
||||
sys.stderr.write("No Debug build files.\n")
|
||||
|
||||
# transfer build/Release files
|
||||
if not options.allowpartial or path_exists(os.path.join(cef_dir, 'Release')):
|
||||
build_dir = os.path.join(out_dir, 'Release');
|
||||
if not options.allowpartial or path_exists(os.path.join(build_dir, 'cefclient.exe')):
|
||||
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_file(os.path.join(cef_dir, 'Release/cefclient.exe'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(cef_dir, 'Release/devtools_resources.pak'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(cef_dir, 'Release/icudt.dll'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(cef_dir, 'Release/libcef.dll'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(cef_dir, 'Release/libEGL.dll'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(cef_dir, 'Release/libGLESv2.dll'), dst_dir, options.quiet)
|
||||
copy_dir(os.path.join(cef_dir, 'Release/locales'), os.path.join(dst_dir, 'locales'), \
|
||||
copy_files(os.path.join(build_dir, '*.dll'), dst_dir, options.quiet)
|
||||
if not options.minimal:
|
||||
copy_file(os.path.join(build_dir, 'cefclient.exe'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'devtools_resources.pak'), dst_dir, options.quiet)
|
||||
copy_dir(os.path.join(build_dir, 'locales'), os.path.join(dst_dir, 'locales'), \
|
||||
options.quiet)
|
||||
|
||||
# transfer lib/Release files
|
||||
dst_dir = os.path.join(output_dir, 'lib/Release')
|
||||
make_dir(dst_dir, options.quiet)
|
||||
copy_file(os.path.join(cef_dir, 'Release/lib/libcef.lib'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, libcef_dll_file), os.path.join(dst_dir, 'libcef.lib'), \
|
||||
options.quiet)
|
||||
|
||||
# transfer symbols
|
||||
copy_file(os.path.join(cef_dir, 'Release/libcef.dll.pdb'), symbol_dir, options.quiet)
|
||||
if not options.nosymbols:
|
||||
# transfer symbols
|
||||
copy_file(os.path.join(build_dir, 'libcef.dll.pdb'), symbol_dir, options.quiet)
|
||||
else:
|
||||
sys.stderr.write("No Release build files.\n")
|
||||
|
||||
# generate doc files
|
||||
os.popen('make_cppdocs.bat '+cef_rev)
|
||||
if not options.minimal:
|
||||
# generate doc files
|
||||
os.popen('make_cppdocs.bat '+cef_rev)
|
||||
|
||||
# transfer docs files
|
||||
dst_dir = os.path.join(output_dir, 'docs')
|
||||
src_dir = os.path.join(cef_dir, 'docs')
|
||||
if path_exists(src_dir):
|
||||
copy_dir(src_dir, dst_dir, options.quiet)
|
||||
# transfer docs files
|
||||
dst_dir = os.path.join(output_dir, 'docs')
|
||||
src_dir = os.path.join(cef_dir, 'docs')
|
||||
if path_exists(src_dir):
|
||||
copy_dir(src_dir, dst_dir, options.quiet)
|
||||
|
||||
# transfer additional files, if any
|
||||
transfer_files(cef_dir, script_dir, os.path.join(script_dir, 'distrib/win/transfer.cfg'), \
|
||||
output_dir, options.quiet)
|
||||
# transfer additional files, if any
|
||||
transfer_files(cef_dir, script_dir, os.path.join(script_dir, 'distrib/win/transfer.cfg'), \
|
||||
output_dir, options.quiet)
|
||||
|
||||
# generate the project files
|
||||
generate_msvs_projects('2005');
|
||||
generate_msvs_projects('2008');
|
||||
generate_msvs_projects('2010');
|
||||
fix_msvs_projects();
|
||||
# generate the project files
|
||||
generate_msvs_projects('2005');
|
||||
generate_msvs_projects('2008');
|
||||
generate_msvs_projects('2010');
|
||||
fix_msvs_projects();
|
||||
|
||||
elif platform == 'macosx':
|
||||
# create the README.TXT file
|
||||
create_readme(os.path.join(script_dir, 'distrib/mac/README.txt'), output_dir, cef_url, \
|
||||
cef_rev, cef_ver, chromium_url, chromium_rev, chromium_ver, date)
|
||||
|
||||
# transfer include files
|
||||
transfer_gypi_files(cef_dir, cef_paths2['includes_mac'], \
|
||||
'include/', include_dir, options.quiet)
|
||||
|
||||
# transfer cefclient files
|
||||
transfer_gypi_files(cef_dir, cef_paths2['cefclient_sources_mac'], \
|
||||
'tests/cefclient/', cefclient_dir, options.quiet)
|
||||
transfer_gypi_files(cef_dir, cef_paths2['cefclient_bundle_resources_mac'], \
|
||||
'tests/cefclient/', cefclient_dir, options.quiet)
|
||||
if not options.minimal:
|
||||
# transfer include files
|
||||
transfer_gypi_files(cef_dir, cef_paths2['includes_mac'], \
|
||||
'include/', include_dir, options.quiet)
|
||||
|
||||
# transfer cefclient files
|
||||
transfer_gypi_files(cef_dir, cef_paths2['cefclient_sources_mac'], \
|
||||
'tests/cefclient/', cefclient_dir, options.quiet)
|
||||
transfer_gypi_files(cef_dir, cef_paths2['cefclient_bundle_resources_mac'], \
|
||||
'tests/cefclient/', cefclient_dir, options.quiet)
|
||||
|
||||
# transfer cefclient/mac files
|
||||
copy_dir(os.path.join(cef_dir, 'tests/cefclient/mac/'), os.path.join(output_dir, 'cefclient/mac/'), \
|
||||
options.quiet)
|
||||
|
||||
if options.ninjabuild:
|
||||
out_dir = os.path.join(src_dir, 'out')
|
||||
else:
|
||||
out_dir = os.path.join(src_dir, 'xcodebuild')
|
||||
|
||||
valid_build_dir = None
|
||||
|
||||
if not options.minimal:
|
||||
# transfer xcodebuild/Debug files
|
||||
build_dir = os.path.join(out_dir, 'Debug')
|
||||
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_file(os.path.join(build_dir, 'libcef.dylib'), dst_dir, options.quiet)
|
||||
|
||||
# transfer cefclient/mac files
|
||||
copy_dir(os.path.join(cef_dir, 'tests/cefclient/mac/'), os.path.join(output_dir, 'cefclient/mac/'), \
|
||||
options.quiet)
|
||||
|
||||
# transfer xcodebuild/Debug files
|
||||
if not options.allowpartial or path_exists(os.path.join(cef_dir, '../xcodebuild/Debug')):
|
||||
dst_dir = os.path.join(output_dir, 'Debug')
|
||||
make_dir(dst_dir, options.quiet)
|
||||
copy_file(os.path.join(cef_dir, '../xcodebuild/Debug/libcef.dylib'), dst_dir, options.quiet)
|
||||
|
||||
# transfer xcodebuild/Release files
|
||||
if not options.allowpartial or path_exists(os.path.join(cef_dir, '../xcodebuild/Release')):
|
||||
build_dir = os.path.join(out_dir, 'Release')
|
||||
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)
|
||||
copy_file(os.path.join(cef_dir, '../xcodebuild/Release/libcef.dylib'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'libcef.dylib'), dst_dir, options.quiet)
|
||||
|
||||
# create the real dSYM file from the "fake" dSYM file
|
||||
sys.stdout.write("Creating the real dSYM file...\n")
|
||||
src_path = os.path.join(cef_dir, '../xcodebuild/Release/libcef.dylib.dSYM/Contents/Resources/DWARF/libcef.dylib')
|
||||
dst_path = os.path.join(symbol_dir, 'libcef.dylib.dSYM')
|
||||
run('dsymutil '+src_path+' -o '+dst_path, cef_dir)
|
||||
if not options.nosymbols:
|
||||
# create the real dSYM file from the "fake" dSYM file
|
||||
sys.stdout.write("Creating the real dSYM file...\n")
|
||||
src_path = os.path.join(build_dir, 'libcef.dylib.dSYM/Contents/Resources/DWARF/libcef.dylib')
|
||||
dst_path = os.path.join(symbol_dir, 'libcef.dylib.dSYM')
|
||||
run('dsymutil '+src_path+' -o '+dst_path, cef_dir)
|
||||
|
||||
# transfer resource files
|
||||
dst_dir = os.path.join(output_dir, 'Resources')
|
||||
make_dir(dst_dir, options.quiet)
|
||||
copy_files(os.path.join(cef_dir, '../third_party/WebKit/Source/WebCore/Resources/*.*'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(cef_dir, '../xcodebuild/Release/cefclient.app/Contents/Resources/chrome.pak'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(cef_dir, '../xcodebuild/Release/cefclient.app/Contents/Resources/devtools_resources.pak'), dst_dir, options.quiet)
|
||||
copy_files(os.path.join(cef_dir, '../xcodebuild/Release/cefclient.app/Contents/Resources/*.lproj'), dst_dir, options.quiet)
|
||||
remove_dir(os.path.join(dst_dir, 'English.lproj'))
|
||||
|
||||
# transfer additional files, if any
|
||||
transfer_files(cef_dir, script_dir, os.path.join(script_dir, 'distrib/mac/transfer.cfg'), \
|
||||
output_dir, options.quiet)
|
||||
if not valid_build_dir is None:
|
||||
# transfer resource files
|
||||
build_dir = valid_build_dir
|
||||
dst_dir = os.path.join(output_dir, 'Resources')
|
||||
make_dir(dst_dir, options.quiet)
|
||||
copy_files(os.path.join(cef_dir, '../third_party/WebKit/Source/WebCore/Resources/*.*'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'cefclient.app/Contents/Resources/chrome.pak'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'cefclient.app/Contents/Resources/devtools_resources.pak'), dst_dir, options.quiet)
|
||||
copy_files(os.path.join(build_dir, 'cefclient.app/Contents/Resources/*.lproj'), dst_dir, options.quiet)
|
||||
remove_dir(os.path.join(dst_dir, 'English.lproj'))
|
||||
|
||||
# Generate Xcode project files
|
||||
sys.stdout.write('Generating Xcode project files...')
|
||||
gyper = [ 'python', 'tools/gyp_cef', os.path.relpath(os.path.join(output_dir, 'cefclient.gyp'), cef_dir) ]
|
||||
RunAction(cef_dir, gyper);
|
||||
|
||||
# Post-process the Xcode project to fix file paths
|
||||
src_file = os.path.join(output_dir, 'cefclient.xcodeproj/project.pbxproj')
|
||||
data = read_file(src_file)
|
||||
data = data.replace('../../../build/mac/', 'tools/')
|
||||
data = data.replace('../../../', '')
|
||||
write_file(src_file, data)
|
||||
if not options.minimal:
|
||||
# transfer additional files, if any
|
||||
transfer_files(cef_dir, script_dir, os.path.join(script_dir, 'distrib/mac/transfer.cfg'), \
|
||||
output_dir, options.quiet)
|
||||
|
||||
# Generate Xcode project files
|
||||
sys.stdout.write('Generating Xcode project files...')
|
||||
os.environ['GYP_GENERATORS'] = 'xcode'
|
||||
gyper = [ 'python', 'tools/gyp_cef', os.path.relpath(os.path.join(output_dir, 'cefclient.gyp'), cef_dir) ]
|
||||
RunAction(cef_dir, gyper);
|
||||
|
||||
# Post-process the Xcode project to fix file paths
|
||||
src_file = os.path.join(output_dir, 'cefclient.xcodeproj/project.pbxproj')
|
||||
data = read_file(src_file)
|
||||
data = data.replace('../../../build/mac/', 'tools/')
|
||||
data = data.replace('../../../build', 'build')
|
||||
data = data.replace('../../../xcodebuild', 'xcodebuild')
|
||||
write_file(src_file, data)
|
||||
|
||||
elif platform == 'linux':
|
||||
linux_build_dir = os.path.join(cef_dir, os.pardir, 'out')
|
||||
|
||||
# create the README.TXT file
|
||||
create_readme(os.path.join(script_dir, 'distrib/linux/README.txt'), output_dir, cef_url, \
|
||||
cef_rev, cef_ver, chromium_url, chromium_rev, chromium_ver, date)
|
||||
|
||||
# transfer build/Debug files
|
||||
if not options.allowpartial or path_exists(os.path.join(linux_build_dir, 'Debug')):
|
||||
dst_dir = os.path.join(output_dir, 'Debug')
|
||||
make_dir(dst_dir, options.quiet)
|
||||
copy_dir(os.path.join(linux_build_dir, 'Debug/lib.target'), os.path.join(dst_dir, 'lib.target'), options.quiet)
|
||||
copy_file(os.path.join(linux_build_dir, 'Debug/cefclient'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(linux_build_dir, 'Debug/chrome.pak'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(linux_build_dir, 'Debug/devtools_resources.pak'), dst_dir, options.quiet)
|
||||
copy_dir(os.path.join(linux_build_dir, 'Debug/locales'), os.path.join(dst_dir, 'locales'), options.quiet)
|
||||
|
||||
out_dir = os.path.join(src_dir, 'out')
|
||||
if options.ninjabuild:
|
||||
lib_dir_name = 'lib'
|
||||
else:
|
||||
sys.stderr.write("No Debug build files.\n")
|
||||
lib_dir_name = 'lib.target'
|
||||
|
||||
# transfer build/Release files
|
||||
if not options.allowpartial or path_exists(os.path.join(linux_build_dir, 'Release')):
|
||||
valid_build_dir = None
|
||||
|
||||
if not options.minimal:
|
||||
# transfer out/Debug files
|
||||
build_dir = os.path.join(out_dir, 'Debug');
|
||||
if not options.allowpartial or path_exists(os.path.join(build_dir, 'cefclient')):
|
||||
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, lib_dir_name, 'libcef.so'), dst_dir, options.quiet)
|
||||
else:
|
||||
sys.stderr.write("No Debug build files.\n")
|
||||
|
||||
# transfer out/Release files
|
||||
build_dir = os.path.join(out_dir, 'Release');
|
||||
if not options.allowpartial or path_exists(os.path.join(build_dir, 'cefclient')):
|
||||
valid_build_dir = build_dir
|
||||
dst_dir = os.path.join(output_dir, 'Release')
|
||||
make_dir(dst_dir, options.quiet)
|
||||
copy_dir(os.path.join(linux_build_dir, 'Release/lib.target'), os.path.join(dst_dir, 'lib.target'), options.quiet)
|
||||
copy_file(os.path.join(linux_build_dir, 'Release/cefclient'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(linux_build_dir, 'Release/chrome.pak'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(linux_build_dir, 'Release/devtools_resources.pak'), dst_dir, options.quiet)
|
||||
copy_dir(os.path.join(linux_build_dir, 'Release/locales'), os.path.join(dst_dir, 'locales'), options.quiet)
|
||||
|
||||
copy_file(os.path.join(build_dir, lib_dir_name, 'libcef.so'), dst_dir, options.quiet)
|
||||
else:
|
||||
sys.stderr.write("No Release build files.\n")
|
||||
|
||||
# transfer include files
|
||||
transfer_gypi_files(cef_dir, cef_paths2['includes_linux'], \
|
||||
'include/', include_dir, options.quiet)
|
||||
if not valid_build_dir is None:
|
||||
# transfer resource files
|
||||
build_dir = valid_build_dir
|
||||
dst_dir = os.path.join(output_dir, 'Resources')
|
||||
make_dir(dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'chrome.pak'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'devtools_resources.pak'), dst_dir, options.quiet)
|
||||
copy_dir(os.path.join(build_dir, 'locales'), os.path.join(dst_dir, 'locales'), options.quiet)
|
||||
|
||||
# transfer cefclient files
|
||||
transfer_gypi_files(cef_dir, cef_paths2['cefclient_sources_linux'], \
|
||||
'tests/cefclient/', cefclient_dir, options.quiet)
|
||||
if not options.minimal:
|
||||
# transfer include files
|
||||
transfer_gypi_files(cef_dir, cef_paths2['includes_linux'], \
|
||||
'include/', include_dir, options.quiet)
|
||||
|
||||
# transfer additional files, if any
|
||||
transfer_files(cef_dir, script_dir, os.path.join(script_dir, 'distrib/linux/transfer.cfg'), \
|
||||
output_dir, options.quiet)
|
||||
# transfer cefclient files
|
||||
transfer_gypi_files(cef_dir, cef_paths2['cefclient_sources_linux'], \
|
||||
'tests/cefclient/', cefclient_dir, options.quiet)
|
||||
transfer_gypi_files(cef_dir, cef_paths2['cefclient_bundle_resources_linux'], \
|
||||
'tests/cefclient/', cefclient_dir, options.quiet)
|
||||
|
||||
# transfer additional files, if any
|
||||
copy_file(os.path.join(script_dir, 'distrib/linux/build.sh'), output_dir, options.quiet)
|
||||
transfer_files(cef_dir, script_dir, os.path.join(script_dir, 'distrib/linux/transfer.cfg'), \
|
||||
output_dir, options.quiet)
|
||||
|
||||
makefile = os.path.join(src_dir, 'Makefile')
|
||||
makefile_tmp = ''
|
||||
if path_exists(makefile):
|
||||
# Back up the existing Makefile
|
||||
makefile_tmp = makefile + '.cef_bak'
|
||||
copy_file(makefile, makefile_tmp, options.quiet)
|
||||
|
||||
# Generate make project files
|
||||
sys.stdout.write('Generating make project files...')
|
||||
os.environ['GYP_GENERATORS'] = 'make'
|
||||
gyper = [ 'python', 'tools/gyp_cef', os.path.relpath(os.path.join(output_dir, 'cefclient.gyp'), cef_dir) ]
|
||||
RunAction(cef_dir, gyper);
|
||||
|
||||
# Copy the resulting Makefile to the destination directory
|
||||
copy_file(makefile, output_dir, options.quiet)
|
||||
|
||||
remove_file(makefile, options.quiet)
|
||||
if makefile_tmp != '':
|
||||
# Restore the original Makefile
|
||||
move_file(makefile_tmp, makefile, options.quiet)
|
||||
|
||||
# Post-process the make files
|
||||
fix_make_projects()
|
||||
|
||||
# Create an archive of the output directory
|
||||
zip_file = os.path.split(output_dir)[1] + '.zip'
|
||||
zip_file = output_dir_name + '.zip'
|
||||
if not options.quiet:
|
||||
sys.stdout.write('Creating '+zip_file+"...\n")
|
||||
create_archive(output_dir, os.path.join(output_dir, os.pardir, zip_file))
|
||||
|
||||
# Create an archive of the symbol directory
|
||||
zip_file = os.path.split(symbol_dir)[1] + '.zip'
|
||||
if not options.quiet:
|
||||
sys.stdout.write('Creating '+zip_file+"...\n")
|
||||
create_archive(symbol_dir, os.path.join(symbol_dir, os.pardir, zip_file))
|
||||
if not options.nosymbols:
|
||||
# Create an archive of the symbol directory
|
||||
zip_file = symbol_dir_name + '.zip'
|
||||
if not options.quiet:
|
||||
sys.stdout.write('Creating '+zip_file+"...\n")
|
||||
create_archive(symbol_dir, os.path.join(symbol_dir, os.pardir, zip_file))
|
||||
|
Reference in New Issue
Block a user