Bug 197318 - Clarify linking of WebKitPluginHost.app and WebKitPluginAgent
Summary: Clarify linking of WebKitPluginHost.app and WebKitPluginAgent
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jonathan Bedard
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-04-26 10:34 PDT by Jonathan Bedard
Modified: 2019-04-26 22:59 PDT (History)
8 users (show)

See Also:


Attachments
Patch (5.52 KB, patch)
2019-04-26 10:41 PDT, Jonathan Bedard
jbedard: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.