Add script to generate WebContent service resource files
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Aug 2018 21:59:05 +0000 (21:59 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Aug 2018 21:59:05 +0000 (21:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=188601

Patch by Ben Richards <benton_richards@apple.com> on 2018-08-16
Reviewed by Dan Bernstein.

Added new build phase to WebContent service to copy resource files to WebKit.framework/PrivateHeaders/CustomWebContentResource.
These resources are intended to be used by a client to create a custom WebContent service.

* Scripts/copy-webcontent-resources-to-private-headers.sh: Added.
* WebKit.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234958 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/Scripts/copy-webcontent-resources-to-private-headers.sh [new file with mode: 0755]
Source/WebKit/WebKit.xcodeproj/project.pbxproj

index 8b394d5..79bb871 100644 (file)
@@ -1,3 +1,16 @@
+2018-08-16  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 Dan Bernstein.
+
+        Added new build phase to WebContent service to copy resource files to WebKit.framework/PrivateHeaders/CustomWebContentResource.
+        These resources are intended to be used by a client to create a custom WebContent service.
+
+        * Scripts/copy-webcontent-resources-to-private-headers.sh: Added.
+        * WebKit.xcodeproj/project.pbxproj:
+
 2018-08-16  Alex Christensen  <achristensen@webkit.org>
 
         Consolidate data/string API loading paths
diff --git a/Source/WebKit/Scripts/copy-webcontent-resources-to-private-headers.sh b/Source/WebKit/Scripts/copy-webcontent-resources-to-private-headers.sh
new file mode 100755 (executable)
index 0000000..de2d961
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+set -e
+
+WEB_CONTENT_RESOURCES_PATH="${BUILT_PRODUCTS_DIR}/WebKit.framework/PrivateHeaders/CustomWebContentResources"
+mkdir -p "${WEB_CONTENT_RESOURCES_PATH}"
+
+echo "Copying WebContent entitlements to ${WEB_CONTENT_RESOURCES_PATH}"
+ENTITLEMENTS_FILE="${TEMP_FILE_DIR}/${FULL_PRODUCT_NAME}.xcent"
+ditto "${ENTITLEMENTS_FILE}" "${WEB_CONTENT_RESOURCES_PATH}/WebContent.entitlements"
+
+echo "Copying WebContentProcess.xib to ${WEB_CONTENT_RESOURCES_PATH}"
+WEBCONTENT_XIB="${SRCROOT}/Resources/WebContentProcess.xib"
+ditto "${WEBCONTENT_XIB}" "${WEB_CONTENT_RESOURCES_PATH}/WebContentProcess.xib"
+
+echo "Copying Info.plist to ${WEB_CONTENT_RESOURCES_PATH}"
+PROCESSED_INFOPLIST="${BUILT_PRODUCTS_DIR}/${INFOPLIST_PATH}"
+UNPROCESSED_INFOPLIST="${INFOPLIST_FILE}"
+COPIED_INFOPLIST="${WEB_CONTENT_RESOURCES_PATH}/Info.plist"
+ditto "${UNPROCESSED_INFOPLIST}" "${COPIED_INFOPLIST}"
+
+echo "Setting fixed entry values for ${COPIED_INFOPLIST}"
+if [[ ${WK_PLATFORM_NAME} == "macosx" ]]; then
+    FIXED_ENTRIES=( ":XPCService:RunLoopType" )
+else
+    FIXED_ENTRIES=()
+fi
+
+for ((i = 0; i < ${#FIXED_ENTRIES[@]}; ++i)); do
+    ENTRY_VALUE=$(/usr/libexec/PlistBuddy -c "Print ${FIXED_ENTRIES[$i]}" "${PROCESSED_INFOPLIST}")
+    /usr/libexec/PlistBuddy -c "Set ${FIXED_ENTRIES[$i]} ${ENTRY_VALUE}" "${COPIED_INFOPLIST}"
+done
index 865ada9..c4b444e 100644 (file)
                4135FBCF1F4FB7F20074C47B /* CacheStorageEngineCaches.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CacheStorageEngineCaches.cpp; sourceTree = "<group>"; };
                4135FBD01F4FB7F20074C47B /* CacheStorageEngineCaches.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CacheStorageEngineCaches.h; sourceTree = "<group>"; };
                413CCD4F20DEBC2F0065A21A /* com.google.googletalkbrowserplugin.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = com.google.googletalkbrowserplugin.sb; sourceTree = "<group>"; };
+               413E67632125E75400C0F09E /* copy-webcontent-resources-to-private-headers.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "copy-webcontent-resources-to-private-headers.sh"; sourceTree = "<group>"; };
                4143751B20EAEA1E00FAD06C /* cn.microdone.cmb.safari.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cn.microdone.cmb.safari.sb; sourceTree = "<group>"; };
                414DD37820BF43EA006959FB /* com.cisco.webex.plugin.gpc64.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = com.cisco.webex.plugin.gpc64.sb; sourceTree = "<group>"; };
                414DEDD51F9EDDDF0047C40D /* ServiceWorkerProcessProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServiceWorkerProcessProxy.h; sourceTree = "<group>"; };
                        children = (
                                7CDE73A21F9DA59700390312 /* PreferencesTemplates */,
                                0FC0856E187CE0A900780D86 /* __init__.py */,
+                               413E67632125E75400C0F09E /* copy-webcontent-resources-to-private-headers.sh */,
                                C0CE73361247F70E00BC0EC4 /* generate-message-receiver.py */,
                                C0CE73371247F70E00BC0EC4 /* generate-messages-header.py */,
                                7CDE73A11F9DA41400390312 /* GeneratePreferences.rb */,
                                BCDC308D15FDB99A006B6695 /* Frameworks */,
                                BC3DE46415A91763008D26FC /* Resources */,
                                7AFCBD5420B8911D00F55C9C /* Process WebContent entitlements */,
+                               413E67622125E6E800C0F09E /* Copy Custom WebContent Resources to Framework Private Headers */,
                        );
                        buildRules = (
                        );
                        shellPath = /bin/sh;
                        shellScript = "Scripts/process-network-sandbox-entitlements.sh\n";
                };
+               413E67622125E6E800C0F09E /* Copy Custom WebContent Resources to Framework Private Headers */ = {
+                       isa = PBXShellScriptBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       inputFileListPaths = (
+                       );
+                       inputPaths = (
+                               "$(TEMP_FILE_DIR)/$(FULL_PRODUCT_NAME).xcent",
+                               "$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)",
+                               "$(SRCROOT)/Resources/WebContentProcess.xib",
+                       );
+                       name = "Copy Custom WebContent Resources to Framework Private Headers";
+                       outputFileListPaths = (
+                       );
+                       outputPaths = (
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+                       shellPath = /bin/sh;
+                       shellScript = "Scripts/copy-webcontent-resources-to-private-headers.sh\n";
+               };
                5DF408C5131DD46700130071 /* Check For Weak VTables and Externals */ = {
                        isa = PBXShellScriptBuildPhase;
                        buildActionMask = 2147483647;