From 2579b7975a141b75e5499c5095fe75dff6838e8d Mon Sep 17 00:00:00 2001 From: Ethan Wong Date: Sun, 23 May 2021 21:20:33 +0800 Subject: [PATCH 1/3] Make SyncDatabase explicitly depend on RSCore to resolve signing issue --- SyncDatabase/Package.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SyncDatabase/Package.swift b/SyncDatabase/Package.swift index ae85d01d1..15f06261c 100644 --- a/SyncDatabase/Package.swift +++ b/SyncDatabase/Package.swift @@ -11,6 +11,7 @@ let package = Package( targets: ["SyncDatabase"]), ], dependencies: [ + .package(url: "https://github.com/Ranchero-Software/RSCore.git", .upToNextMajor(from: "1.0.0")), .package(url: "https://github.com/Ranchero-Software/RSDatabase.git", .upToNextMajor(from: "1.0.0")), .package(url: "../Articles", .upToNextMajor(from: "1.0.0")), ], @@ -18,6 +19,7 @@ let package = Package( .target( name: "SyncDatabase", dependencies: [ + "RSCore", "RSDatabase", "Articles", ]), From 7402594d7cf2411017ced89f69e4f1e43025b324 Mon Sep 17 00:00:00 2001 From: Ethan Wong Date: Mon, 24 May 2021 13:08:25 +0800 Subject: [PATCH 2/3] Prevent RSCore from being embedded into ShareExtention and cleanup 'Delete Frameworks' code. --- NetNewsWire.xcodeproj/project.pbxproj | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/NetNewsWire.xcodeproj/project.pbxproj b/NetNewsWire.xcodeproj/project.pbxproj index 04c5227ff..6a1181189 100644 --- a/NetNewsWire.xcodeproj/project.pbxproj +++ b/NetNewsWire.xcodeproj/project.pbxproj @@ -241,7 +241,6 @@ 513277652590FC640064F1E7 /* SyncDatabase in Embed Frameworks */ = {isa = PBXBuildFile; productRef = 513277632590FC640064F1E7 /* SyncDatabase */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 513277662590FC780064F1E7 /* Secrets in Embed Frameworks */ = {isa = PBXBuildFile; productRef = 51C4CFF524D37DD500AF9874 /* Secrets */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 5132778C2590FF1E0064F1E7 /* RSCore in Frameworks */ = {isa = PBXBuildFile; productRef = 5132778B2590FF1E0064F1E7 /* RSCore */; }; - 5132778D2590FF1E0064F1E7 /* RSCore in Embed Frameworks */ = {isa = PBXBuildFile; productRef = 5132778B2590FF1E0064F1E7 /* RSCore */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 5132779F2591034D0064F1E7 /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 5132779E2591034D0064F1E7 /* icon.icns */; }; 51333D1624685D2E00EB5C91 /* AddRedditFeedWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51333D1524685D2E00EB5C91 /* AddRedditFeedWindowController.swift */; }; 51333D1724685D2E00EB5C91 /* AddRedditFeedWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51333D1524685D2E00EB5C91 /* AddRedditFeedWindowController.swift */; }; @@ -1291,7 +1290,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - 5132778D2590FF1E0064F1E7 /* RSCore in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -3760,7 +3758,6 @@ 510C415924E5CDE3008226FD /* Frameworks */, 510C415A24E5CDE3008226FD /* Resources */, 513277512590FC000064F1E7 /* Embed Frameworks */, - 51327793259101E50064F1E7 /* Delete Unnecessary Frameworks */, ); buildRules = ( ); @@ -4456,24 +4453,6 @@ shellPath = /bin/sh; shellScript = "if ! command -v swiftgen &> /dev/null\nthen\n echo \"swiftgen could not be found\"\n exit\nfi\n\narch -x86_64 swiftgen run strings -t structured-swift5 \"$PROJECT_DIR/Widget/Resources/en.lproj/Localizable.strings\" \"$PROJECT_DIR/Widget/Resources/Localizable.stringsdict\" --output \"$PROJECT_DIR/Widget/Resources/Localized.swift\";\n"; }; - 51327793259101E50064F1E7 /* Delete Unnecessary Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - name = "Delete Unnecessary Frameworks"; - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "# Delete the framework that Xcode should have never included\n# https://forums.swift.org/t/is-this-an-xcode-bug-or-somehow-related-to-spm/33987\nrm -rf \"${TARGET_BUILD_DIR}/NetNewsWire Share Extension.appex/Contents/Frameworks\"\n"; - }; 513F328A2593EFCE0003048F /* Delete Unnecessary Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; From 6f824a54247148caae8e81673da5f2d6c6a99b83 Mon Sep 17 00:00:00 2001 From: Ethan Wong Date: Mon, 24 May 2021 13:11:12 +0800 Subject: [PATCH 3/3] Add script in main app's build phase to delete unnecessary frameworks for Share Extension (workaround for Xcode 12.5) --- NetNewsWire.xcodeproj/project.pbxproj | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/NetNewsWire.xcodeproj/project.pbxproj b/NetNewsWire.xcodeproj/project.pbxproj index 6a1181189..f3a91740c 100644 --- a/NetNewsWire.xcodeproj/project.pbxproj +++ b/NetNewsWire.xcodeproj/project.pbxproj @@ -4008,6 +4008,7 @@ 84C987A52000AC9E0066B150 /* Run Script: Automated build numbers */, 84B06F681ED37B9000F0B54B /* Embed Frameworks */, 6581C75720CED60100F4AD34 /* Embed App Extensions */, + 7180F95C265B67B800189094 /* Run Script: Delete Unnecessary Frameworks For Share Extension */, D519E77022EE5B4100923F27 /* Run Script: Verify No Build Settings */, 8423E3E3220158E700C3795B /* Run Script: Code Sign Sparkle */, ); @@ -4539,6 +4540,24 @@ shellPath = /bin/sh; shellScript = "xcrun -sdk macosx swiftc -target x86_64-macosx10.11 buildscripts/VerifyNoBuildSettings.swift -o $CONFIGURATION_TEMP_DIR/VerifyNoBS\n$CONFIGURATION_TEMP_DIR/VerifyNoBS ${PROJECT_NAME}.xcodeproj/project.pbxproj\n\nif [ $? -ne 0 ]\nthen\n echo \"error: Build Setting were found in the project.pbxproj file. Most likely you didn't intend to change this file and should revert it.\"\n exit 1\nfi\n"; }; + 7180F95C265B67B800189094 /* Run Script: Delete Unnecessary Frameworks For Share Extension */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Run Script: Delete Unnecessary Frameworks For Share Extension"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# Delete the framework that Xcode should have never included\n# https://forums.swift.org/t/is-this-an-xcode-bug-or-somehow-related-to-spm/33987\nrm -rf \"${TARGET_BUILD_DIR}/${PLUGINS_FOLDER_PATH}/NetNewsWire Share Extension.appex/Contents/Frameworks\"\n"; + }; 8423E3E3220158E700C3795B /* Run Script: Code Sign Sparkle */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647;