From e84f472657e99ac502a233cd4189af90dbe1374b Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Tue, 24 Jun 2025 18:01:33 +1000 Subject: [PATCH 1/2] Add build phase run script to remove Wormholy from release builds --- .../strip-wormholy-from-release.sh | 11 +++++++++++ .../WooCommerce.xcodeproj/project.pbxproj | 19 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100755 Scripts/build-phases/strip-wormholy-from-release.sh diff --git a/Scripts/build-phases/strip-wormholy-from-release.sh b/Scripts/build-phases/strip-wormholy-from-release.sh new file mode 100755 index 00000000000..3d6ac8eb44e --- /dev/null +++ b/Scripts/build-phases/strip-wormholy-from-release.sh @@ -0,0 +1,11 @@ +#!/bin/bash -eu + +if [ "${CONFIGURATION}" != "Release" ]; then + echo "info: Skipping Wormholy removal – not a Release build." + exit 0 +fi + +BUILT_PRODUCTS_DIR=${BUILT_PRODUCTS_DIR:-"$TARGET_BUILD_DIR"} + +# Crude way to remove all the Wormholy files from the build. +rm -rf "$BUILT_PRODUCTS_DIR/Wormholy*" diff --git a/WooCommerce/WooCommerce.xcodeproj/project.pbxproj b/WooCommerce/WooCommerce.xcodeproj/project.pbxproj index 476973dedbf..a01a4aa0459 100644 --- a/WooCommerce/WooCommerce.xcodeproj/project.pbxproj +++ b/WooCommerce/WooCommerce.xcodeproj/project.pbxproj @@ -14487,6 +14487,7 @@ B5650B1020A4CD7F009702D0 /* Embed Frameworks */, 3F1FA85028B60126009E246C /* Embed Foundation Extensions */, 26F81B232BE433A4009EC58E /* Embed Watch Content */, + 3F76AD982E0A849700984880 /* Strip Wormholy from Release build */, ); buildRules = ( ); @@ -15076,6 +15077,24 @@ shellScript = "\"$SRCROOT/../Scripts/build-phases/LintAppLocalizedStringsUsage.sh\"\n"; showEnvVarsInLog = 0; }; + 3F76AD982E0A849700984880 /* Strip Wormholy from Release build */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Strip Wormholy from Release build"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "$SRCROOT/../Scripts/build-phases/strip-wormholy-from-release.sh\n"; + }; 57CCFFD4249D2A5700825FCF /* SwiftLint */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; From ea3e4075615903e71936615a881acbffb9e207f2 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Tue, 24 Jun 2025 18:02:15 +1000 Subject: [PATCH 2/2] HACK to test removal on debug and prototype builds --- .../build-phases/strip-wormholy-from-release.sh | 10 ++++++---- WooCommerce/Classes/AppDelegate.swift | 14 +++++++------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Scripts/build-phases/strip-wormholy-from-release.sh b/Scripts/build-phases/strip-wormholy-from-release.sh index 3d6ac8eb44e..3deb2aaca46 100755 --- a/Scripts/build-phases/strip-wormholy-from-release.sh +++ b/Scripts/build-phases/strip-wormholy-from-release.sh @@ -1,9 +1,11 @@ #!/bin/bash -eu -if [ "${CONFIGURATION}" != "Release" ]; then - echo "info: Skipping Wormholy removal – not a Release build." - exit 0 -fi +# if [ "${CONFIGURATION}" != "Release" ]; then +# echo "info: Skipping Wormholy removal – not a Release build." +# exit 0 +# fi + +# FIXME: Delete from all builds to test the implementation BUILT_PRODUCTS_DIR=${BUILT_PRODUCTS_DIR:-"$TARGET_BUILD_DIR"} diff --git a/WooCommerce/Classes/AppDelegate.swift b/WooCommerce/Classes/AppDelegate.swift index 95d9e7513cb..e0635ff52c5 100644 --- a/WooCommerce/Classes/AppDelegate.swift +++ b/WooCommerce/Classes/AppDelegate.swift @@ -19,9 +19,9 @@ import class Yosemite.ScreenshotStoresManager // In that way, Inject will be available in the entire target. @_exported import Inject -#if DEBUG -import WormholySwift -#endif +//#if DEBUG +//import WormholySwift +//#endif // MARK: - Woo's App Delegate! // @@ -415,10 +415,10 @@ private extension AppDelegate { /// Set up Wormholy only in Debug build configuration /// func setupWormholy() { -#if DEBUG - // We want to activate it programmatically, not using the shake. - Wormholy.shakeEnabled = false -#endif +//#if DEBUG +// // We want to activate it programmatically, not using the shake. +// Wormholy.shakeEnabled = false +//#endif } /// Set up `KeyboardStateProvider`