WebKit Bugzilla
Attachment 347162 Details for
Bug 188601
: Add script to generate WebContent service resource files and change XPC service main SPI to have it's own header
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188601-20180815075903.patch (text/plain), 4.15 KB, created by
Ben Richards
on 2018-08-15 07:59:04 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Ben Richards
Created:
2018-08-15 07:59:04 PDT
Size:
4.15 KB
patch
obsolete
>Subversion Revision: 234865 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 052c175006f65757655e5979303d3fc18d2c7fc7..799922c3a08ea068a752eb058d16d7c9bd4ca439 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,19 @@ >+2018-08-15 Ben Richards <benton_richards@apple.com> >+ >+ Add script to generate WebContent service resource files >+ https://bugs.webkit.org/show_bug.cgi?id=188601 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Added a script that will generate the Info.plist and entitlements files used by the WebContent service and >+ save them to a specified location. This is to help create a custom WebContent service to be used >+ with the setCustomWebContentServiceBundleIdentifier SPI. >+ >+ * Scripts/generate-webcontent-resources: Added. >+ (generate_resource_files_for_device): >+ (parse_destination_path): >+ (main): >+ > 2018-08-14 Fujii Hironori <Hironori.Fujii@sony.com> > > [webkitpy][Win] LayoutTests: test names should be Unix style, separated by slash not backslash >diff --git a/Tools/Scripts/generate-webcontent-resources b/Tools/Scripts/generate-webcontent-resources >new file mode 100755 >index 0000000000000000000000000000000000000000..6b72d0d98c169d3bfcd0fd71af33982988590a88 >--- /dev/null >+++ b/Tools/Scripts/generate-webcontent-resources >@@ -0,0 +1,68 @@ >+#!/usr/bin/env python >+import argparse >+import os >+from plistlib import readPlist, writePlist >+from shutil import copyfile >+import sys >+ >+ >+def generate_resource_files_for_device(device, destination_path): >+ source_root = os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../Source') >+ >+ # Generate Info.plist >+ info_plist_dir = os.path.join(source_root, 'WebKit/WebProcess/EntryPoint/mac/XPCService/WebContentService') >+ info_plist_path = os.path.join(info_plist_dir, 'Info-{}.plist'.format(device)) >+ if device is 'OSX': >+ info_plist = None >+ with file(info_plist_path) as f: >+ info_plist = f.read() >+ info_plist = info_plist.replace('${RUNLOOP_TYPE}', '_WebKit') >+ with open(os.path.join(destination_path, 'Info-OSX.plist'), 'w+') as f: >+ f.write(info_plist) >+ else: >+ copyfile(info_plist_path, os.path.join(destination_path, 'Info-iOS.plist')) >+ >+ # Copy WebContentProcess.xib >+ xib_source = os.path.join(source_root, 'WebKit/Resources/WebContentProcess.xib') >+ xib_destination = os.path.join(destination_path, 'WebContentProcess.xib') >+ copyfile(xib_source, xib_destination) >+ >+ # Generate entitlements >+ configurations_directory = os.path.join(source_root, 'WebKit/Configurations') >+ merged_entitlements = {} >+ for file_name in os.listdir(configurations_directory): >+ if not file_name.startswith('WebContent') or device not in file_name or 'minimalsimulator' in file_name: >+ continue >+ file_path = os.path.join(configurations_directory, file_name) >+ entitlements = readPlist(file_path) >+ merged_entitlements.update(entitlements) >+ writePlist(merged_entitlements, os.path.join(destination_path, 'WebContent-{}.entitlements'.format(device))) >+ >+ print 'Finished generating files for {}'.format(device) >+ >+ >+def parse_destination_path(path): >+ if not os.path.isdir(path): >+ raise argparse.ArgumentTypeError('Invalid destination path: "{}"'.format(path)) >+ return path >+ >+ >+def main(): >+ parser = argparse.ArgumentParser(description='Generate WebContent resource files and store at specified path') >+ parser.add_argument('-p', '--path', type=parse_destination_path, required=True, >+ help='destination path for generated resources') >+ parser.add_argument('-d', '--device', required=True, action='store', choices=['ios', 'osx', 'all'], >+ help='device to generate resources for') >+ args = parser.parse_args() >+ >+ if args.device == 'all': >+ generate_resource_files_for_device('iOS', args.path) >+ generate_resource_files_for_device('OSX', args.path) >+ elif args.device == 'ios': >+ generate_resource_files_for_device('iOS', args.path) >+ elif args.device == 'osx': >+ generate_resource_files_for_device('OSX', args.path) >+ >+ >+if __name__ == '__main__': >+ main()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188601
:
347162
|
347166
|
347178
|
347228
|
347285
|
347297
|
347371
|
347405
|
347418
|
349958
|
350038
|
350047