Bug 197318

Summary: Clarify linking of WebKitPluginHost.app and WebKitPluginAgent
Product: WebKit Reporter: Jonathan Bedard <jbedard>
Component: Tools / TestsAssignee: Jonathan Bedard <jbedard>
Status: NEW ---    
Severity: Normal CC: andersca, ap, jberlin, krollin, lforschler, mitz, ryanhaddad, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch jbedard: commit-queue-

Description Jonathan Bedard 2019-04-26 10:34:17 PDT
The current code which symlinks WebKitPluginHost.app and WebKitPluginAgent is far more confusing than it needs to be.
Comment 1 Jonathan Bedard 2019-04-26 10:40:02 PDT
<rdar://problem/49779225>
Comment 2 Jonathan Bedard 2019-04-26 10:41:19 PDT
Created attachment 368333 [details]
Patch
Comment 3 Jonathan Bedard 2019-04-26 10:47:02 PDT
Because the diffs of Xcode scripts are difficult to read:

Existing code:

Symlink WebKitPluginHost
------------------------------------------------------------
if [[ ${WK_PLATFORM_NAME} != "macosx" ]]; then
    exit 0
fi

[[ -h "${TARGET_BUILD_DIR}/WebKitLegacy.framework/WebKitPluginHost.app" ]] || ln -s Versions/Current/WebKitPluginHost.app "${TARGET_BUILD_DIR}/WebKitLegacy.framework/WebKitPluginHost.app"
[[ ${WK_USE_OVERRIDE_FRAMEWORKS_DIR} == "YES" ]] || [[ -h "${TARGET_BUILD_DIR}/WebKitLegacy.framework/WebKitPluginAgent" ]] || ln -s Versions/Current/WebKitPluginAgent "${TARGET_BUILD_DIR}/WebKitLegacy.framework/WebKitPluginAgent"

if [[ "${CONFIGURATION}" != "Production" && ${ACTION} == "build"  && ! -e "${TARGET_BUILD_DIR}/WebKitLegacy.framework/Versions/A/WebKitPluginHost.app" ]]; then
    if [[ -e "/System/Library/Frameworks/WebKit.framework/WebKitPluginHost.app" ]]; then
        ln -s /System/Library/Frameworks/WebKit.framework/WebKitPluginHost.app "${TARGET_BUILD_DIR}/WebKitLegacy.framework/Versions/A/WebKitPluginHost.app"
    else
        ln -s /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebKitLegacy.framework/WebKitPluginHost.app "${TARGET_BUILD_DIR}/WebKitLegacy.framework/Versions/A/WebKitPluginHost.app"
    fi
fi
------------------------------------------------------------

New Code:

Link WebKitPluginAgent
------------------------------------------------------------
if [[ ${WK_PLATFORM_NAME} != "macosx" || "${WK_USE_OVERRIDE_FRAMEWORKS_DIR}" == "YES" ]]; then
    exit 0
fi

ln -sf /System/Library/Frameworks/WebKit.framework/WebKitPluginAgent "${TARGET_BUILD_DIR}/WebKitLegacy.framework/Versions/Current/WebKitPluginAgent"
ln -sf Versions/Current/WebKitPluginAgent "${TARGET_BUILD_DIR}/WebKitLegacy.framework/WebKitPluginAgent"
------------------------------------------------------------

Link WebKitPluginHost
------------------------------------------------------------
if [[ ${WK_PLATFORM_NAME} != "macosx" || "${WK_USE_OVERRIDE_FRAMEWORKS_DIR}" == "YES" ]]; then
    exit 0
fi

rm -rf "${TARGET_BUILD_DIR}/WebKitLegacy.framework/Versions/Current/WebKitPluginHost.app"
ln -sf /System/Library/Frameworks/WebKit.framework/WebKitPluginHost.app "${TARGET_BUILD_DIR}/WebKitLegacy.framework/Versions/Current/WebKitPluginHost.app"
ln -sf Versions/Current/WebKitPluginHost.app "${TARGET_BUILD_DIR}/WebKitLegacy.framework/WebKitPluginHost.app"
------------------------------------------------------------
Comment 4 Jonathan Bedard 2019-04-26 16:12:49 PDT
Comment on attachment 368333 [details]
Patch

Clearly I am misunderstanding this code since EWS is choking on it.