From 88ca57a6ad66ec840794110ca727d049a892d0f8 Mon Sep 17 00:00:00 2001 From: kmcbride Date: Sat, 24 Apr 2021 13:50:42 -0700 Subject: [PATCH] Fix Xcode 12.5 compatibility --- Cartfile | 2 +- Cartfile.private | 4 +-- Cartfile.resolved | 6 ++--- .../Base/Configurations/Debug.xcconfig | 4 +-- .../xcconfigs/Base/Targets/Framework.xcconfig | 7 +++++ .../xcconfigs/macOS/macOS-Base.xcconfig | 2 +- Mobius.xcodeproj/project.pbxproj | 8 ++++++ MobiusNimble.podspec.json | 2 +- MobiusNimble/Source/NimbleFirstMatchers.swift | 6 ++--- MobiusNimble/Source/NimbleNextMatchers.swift | 6 ++--- Package.resolved | 26 ++++++++++++++++--- Package.swift | 4 +-- .../MobiusCarthageTest/Cartfile | 2 +- .../MobiusCocoaPodsTest/Podfile | 2 +- .../MobiusSPMTest.xcodeproj/project.pbxproj | 6 ++--- Tools/helpers.sh | 7 ----- 16 files changed, 60 insertions(+), 34 deletions(-) diff --git a/Cartfile b/Cartfile index 6f99eb3a..bcec9e50 100644 --- a/Cartfile +++ b/Cartfile @@ -1 +1 @@ -github "Quick/Nimble" ~> 8.0.7 +github "Quick/Nimble" ~> 9.0.1 diff --git a/Cartfile.private b/Cartfile.private index 402130e6..dafa5d3f 100644 --- a/Cartfile.private +++ b/Cartfile.private @@ -1,2 +1,2 @@ -github "Quick/Quick" ~> 2.0 -github "jspahrsummers/xcconfigs" == 1.0 +github "Quick/Quick" ~> 3.1.2 +github "jspahrsummers/xcconfigs" ~> 1.1 diff --git a/Cartfile.resolved b/Cartfile.resolved index 10cdcbf2..6aabc8ce 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,3 +1,3 @@ -github "Quick/Nimble" "v8.0.7" -github "Quick/Quick" "v2.2.0" -github "jspahrsummers/xcconfigs" "1.0" +github "Quick/Nimble" "v9.0.1" +github "Quick/Quick" "v3.1.2" +github "jspahrsummers/xcconfigs" "1.1" diff --git a/Carthage/Checkouts/xcconfigs/Base/Configurations/Debug.xcconfig b/Carthage/Checkouts/xcconfigs/Base/Configurations/Debug.xcconfig index 65c62abb..c9eba671 100644 --- a/Carthage/Checkouts/xcconfigs/Base/Configurations/Debug.xcconfig +++ b/Carthage/Checkouts/xcconfigs/Base/Configurations/Debug.xcconfig @@ -47,5 +47,5 @@ STRIP_INSTALLED_PRODUCT = NO // The optimization level (-Onone, -O, -Osize) for the produced Swift binary SWIFT_OPTIMIZATION_LEVEL = -Onone -// Disable Developer ID timestamping -OTHER_CODE_SIGN_FLAGS = --timestamp=none +// Use a faster hashing algorithm for signing and disable Developer ID timestamping +OTHER_CODE_SIGN_FLAGS = --digest-algorithm=sha1 --timestamp=none diff --git a/Carthage/Checkouts/xcconfigs/Base/Targets/Framework.xcconfig b/Carthage/Checkouts/xcconfigs/Base/Targets/Framework.xcconfig index c92f57fe..af3bf776 100644 --- a/Carthage/Checkouts/xcconfigs/Base/Targets/Framework.xcconfig +++ b/Carthage/Checkouts/xcconfigs/Base/Targets/Framework.xcconfig @@ -31,6 +31,13 @@ INSTALL_PATH = @rpath LD_DYLIB_INSTALL_NAME = @rpath/$(PRODUCT_NAME).$(WRAPPER_EXTENSION)/$(PRODUCT_NAME) SKIP_INSTALL = YES +// Make SwiftUI previews work in frameworks that depend on other non-system +// frameworks. The Xcode agent that renders SwiftUI previews seems to copy all +// required frameworks from the built product into a single temp directory. +// This allows the rendering agent to find the frameworks there. +// Source: https://github.com/NSHipster/articles/issues/673 +LD_RUNPATH_SEARCH_PATHS = $(inherited) @loader_path/.. + // Disallows use of APIs that are not available // to app extensions and linking to frameworks // that have not been built with this setting enabled. diff --git a/Carthage/Checkouts/xcconfigs/macOS/macOS-Base.xcconfig b/Carthage/Checkouts/xcconfigs/macOS/macOS-Base.xcconfig index 0eaacbc0..fe31ff95 100644 --- a/Carthage/Checkouts/xcconfigs/macOS/macOS-Base.xcconfig +++ b/Carthage/Checkouts/xcconfigs/macOS/macOS-Base.xcconfig @@ -13,4 +13,4 @@ COMBINE_HIDPI_IMAGES = YES SDKROOT = macosx // Supported build architectures -VALID_ARCHS = x86_64 +VALID_ARCHS = arm64 arm64e i386 x86_64 diff --git a/Mobius.xcodeproj/project.pbxproj b/Mobius.xcodeproj/project.pbxproj index 4bf137c6..5ed45a1e 100644 --- a/Mobius.xcodeproj/project.pbxproj +++ b/Mobius.xcodeproj/project.pbxproj @@ -1659,6 +1659,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 69C12F79222F225500DC4F9E /* iOS-StaticLibrary.xcconfig */; buildSettings = { + ENABLE_TESTING_SEARCH_PATHS = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PLATFORM_DIR)/Developer/Library/Frameworks", @@ -1671,6 +1672,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 69C12F79222F225500DC4F9E /* iOS-StaticLibrary.xcconfig */; buildSettings = { + ENABLE_TESTING_SEARCH_PATHS = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PLATFORM_DIR)/Developer/Library/Frameworks", @@ -1794,6 +1796,7 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_BITCODE = NO; + ENABLE_TESTING_SEARCH_PATHS = YES; INFOPLIST_FILE = "$(SRCROOT)/MobiusNimble/BuildSystem/MobiusNimble-Info.plist"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -1818,6 +1821,7 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_BITCODE = NO; + ENABLE_TESTING_SEARCH_PATHS = YES; INFOPLIST_FILE = "$(SRCROOT)/MobiusNimble/BuildSystem/MobiusNimble-Info.plist"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -1863,6 +1867,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 69C12F79222F225500DC4F9E /* iOS-StaticLibrary.xcconfig */; buildSettings = { + ENABLE_TESTING_SEARCH_PATHS = YES; PRODUCT_NAME = MobiusNimble; }; name = Debug; @@ -1871,6 +1876,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 69C12F79222F225500DC4F9E /* iOS-StaticLibrary.xcconfig */; buildSettings = { + ENABLE_TESTING_SEARCH_PATHS = YES; PRODUCT_NAME = MobiusNimble; }; name = Release; @@ -1886,6 +1892,7 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_BITCODE = NO; + ENABLE_TESTING_SEARCH_PATHS = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PLATFORM_DIR)/Developer/Library/Frameworks", @@ -1914,6 +1921,7 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_BITCODE = NO; + ENABLE_TESTING_SEARCH_PATHS = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PLATFORM_DIR)/Developer/Library/Frameworks", diff --git a/MobiusNimble.podspec.json b/MobiusNimble.podspec.json index 94972460..484369e7 100644 --- a/MobiusNimble.podspec.json +++ b/MobiusNimble.podspec.json @@ -30,7 +30,7 @@ "0.4.0" ], "Nimble": [ - "~> 8.0.7" + "~> 9.0.1" ] } } diff --git a/MobiusNimble/Source/NimbleFirstMatchers.swift b/MobiusNimble/Source/NimbleFirstMatchers.swift index 366ecee0..22382f1a 100644 --- a/MobiusNimble/Source/NimbleFirstMatchers.swift +++ b/MobiusNimble/Source/NimbleFirstMatchers.swift @@ -53,7 +53,7 @@ public func haveModel(_ expected: Model) -> Nimble.Pre let actualDescription = String(describing: first.model) return PredicateResult( bool: first.model == expected, - message: .expectedCustomValueTo("be <\(expectedDescription)>", "<\(actualDescription)>") + message: .expectedCustomValueTo("be <\(expectedDescription)>", actual: "<\(actualDescription)>") ) }) } @@ -70,7 +70,7 @@ public func haveNoEffects() -> Nimble.Predicate") + message: .expectedCustomValueTo("have no effect", actual: "<\(actualDescription)>") ) }) } @@ -92,7 +92,7 @@ public func haveEffects(_ effects: [Effect]) -> Nimble bool: effects.allSatisfy(first.effects.contains), message: .expectedCustomValueTo( "contain <\(expectedDescription)>", - "<\(actualDescription)> (order doesn't matter)" + actual: "<\(actualDescription)> (order doesn't matter)" ) ) }) diff --git a/MobiusNimble/Source/NimbleNextMatchers.swift b/MobiusNimble/Source/NimbleNextMatchers.swift index 2223145f..9124d0e6 100644 --- a/MobiusNimble/Source/NimbleNextMatchers.swift +++ b/MobiusNimble/Source/NimbleNextMatchers.swift @@ -57,7 +57,7 @@ public func haveNoModel() -> Nimble.Predicate } return Nimble.PredicateResult( bool: next.model == nil, - message: .expectedCustomValueTo("have no model", "<\(actualDescription)>") + message: .expectedCustomValueTo("have no model", actual: "<\(actualDescription)>") ) }) } @@ -89,7 +89,7 @@ public func haveModel(_ expected: Model) -> Nimble.Pre let actualDescription = String(describing: nextModel) return Nimble.PredicateResult( bool: nextModel == expected, - message: .expectedCustomValueTo("be <\(expectedDescription)>", "<\(actualDescription)>") + message: .expectedCustomValueTo("be <\(expectedDescription)>", actual: "<\(actualDescription)>") ) }) } @@ -122,7 +122,7 @@ public func haveEffects(_ expected: [Effect]) -> Nimbl bool: expected.allSatisfy(next.effects.contains), message: .expectedCustomValueTo( "contain <\(expectedDescription)>", - "<\(actualDescription)> (order doesn't matter)" + actual: "<\(actualDescription)> (order doesn't matter)" ) ) }) diff --git a/Package.resolved b/Package.resolved index 31856671..fce36425 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,13 +1,31 @@ { "object": { "pins": [ + { + "package": "CwlCatchException", + "repositoryURL": "https://github.com/mattgallagher/CwlCatchException.git", + "state": { + "branch": null, + "revision": "f809deb30dc5c9d9b78c872e553261a61177721a", + "version": "2.0.0" + } + }, + { + "package": "CwlPreconditionTesting", + "repositoryURL": "https://github.com/mattgallagher/CwlPreconditionTesting.git", + "state": { + "branch": null, + "revision": "02b7a39a99c4da27abe03cab2053a9034379639f", + "version": "2.0.0" + } + }, { "package": "Nimble", "repositoryURL": "https://github.com/Quick/Nimble", "state": { "branch": null, - "revision": "7fd118ec8795888bcbbebc1a41f6984454c4cd6f", - "version": "8.0.7" + "revision": "7a54aaf19a8ef16f67787c260fda81ead7ba4d67", + "version": "9.0.1" } }, { @@ -15,8 +33,8 @@ "repositoryURL": "https://github.com/Quick/Quick", "state": { "branch": null, - "revision": "33682c2f6230c60614861dfc61df267e11a1602f", - "version": "2.2.0" + "revision": "8cce6acd38f965f5baa3167b939f86500314022b", + "version": "3.1.2" } } ] diff --git a/Package.swift b/Package.swift index 1c8e6256..2dd0f73a 100644 --- a/Package.swift +++ b/Package.swift @@ -16,8 +16,8 @@ let package = Package( .library(name: "MobiusTest", targets: ["MobiusTest"]), ], dependencies: [ - .package(url: "https://github.com/Quick/Nimble", from: "8.0.7"), - .package(url: "https://github.com/Quick/Quick", from: "2.2.0"), + .package(url: "https://github.com/Quick/Nimble", from: "9.0.1"), + .package(url: "https://github.com/Quick/Quick", from: "3.1.2"), ], targets: [ .target(name: "MobiusCore", path: "MobiusCore/Source"), diff --git a/Tools/BuildSystemTests/MobiusCarthageTest/Cartfile b/Tools/BuildSystemTests/MobiusCarthageTest/Cartfile index ef863d00..69c16138 100644 --- a/Tools/BuildSystemTests/MobiusCarthageTest/Cartfile +++ b/Tools/BuildSystemTests/MobiusCarthageTest/Cartfile @@ -1,2 +1,2 @@ github "spotify/Mobius.swift" "master" -github "Quick/Nimble" ~> 8.0.7 +github "Quick/Nimble" ~> 9.0.1 diff --git a/Tools/BuildSystemTests/MobiusCocoaPodsTest/Podfile b/Tools/BuildSystemTests/MobiusCocoaPodsTest/Podfile index ade8eda9..909ea515 100644 --- a/Tools/BuildSystemTests/MobiusCocoaPodsTest/Podfile +++ b/Tools/BuildSystemTests/MobiusCocoaPodsTest/Podfile @@ -5,5 +5,5 @@ target 'MobiusCocoaPodsTest' do pod 'MobiusExtras', :path => '../../../' pod 'MobiusNimble', :path => '../../../' pod 'MobiusTest', :path => '../../../' - pod 'Nimble', '~> 8.0.7' + pod 'Nimble', '~> 9.0.1' end diff --git a/Tools/BuildSystemTests/MobiusSPMTest/MobiusSPMTest.xcodeproj/project.pbxproj b/Tools/BuildSystemTests/MobiusSPMTest/MobiusSPMTest.xcodeproj/project.pbxproj index df4e4de3..9cb87da6 100644 --- a/Tools/BuildSystemTests/MobiusSPMTest/MobiusSPMTest.xcodeproj/project.pbxproj +++ b/Tools/BuildSystemTests/MobiusSPMTest/MobiusSPMTest.xcodeproj/project.pbxproj @@ -543,7 +543,7 @@ repositoryURL = "https://github.com/Quick/Nimble"; requirement = { kind = upToNextMajorVersion; - minimumVersion = 8.0.7; + minimumVersion = 9.0.1; }; }; 2D35A2CD241F8FE400C344AC /* XCRemoteSwiftPackageReference "Mobius.swift" */ = { @@ -559,7 +559,7 @@ repositoryURL = "https://github.com/Quick/Nimble"; requirement = { kind = upToNextMajorVersion; - minimumVersion = 8.0.7; + minimumVersion = 9.0.1; }; }; 2D35A2E2241F910200C344AC /* XCRemoteSwiftPackageReference "Mobius.swift" */ = { @@ -575,7 +575,7 @@ repositoryURL = "https://github.com/Quick/Nimble"; requirement = { kind = upToNextMajorVersion; - minimumVersion = 8.0.7; + minimumVersion = 9.0.1; }; }; 2D35A2F7241F911700C344AC /* XCRemoteSwiftPackageReference "Mobius.swift" */ = { diff --git a/Tools/helpers.sh b/Tools/helpers.sh index 032b7b6a..36ac8a07 100755 --- a/Tools/helpers.sh +++ b/Tools/helpers.sh @@ -40,13 +40,6 @@ do_carthage_bootstrap() { mkdir -p build carthage checkout - # h4x: patch nimble to legacy build system to work around issue - # https://github.com/Quick/Nimble/issues/702 - if [[ "$IS_CI" == "1" ]]; then - patch_to_legacy_build_system "Carthage/Checkouts/Nimble/Nimble.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings" - patch_to_legacy_build_system "Carthage/Checkouts/Quick/Quick.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings" - fi - carthage build --platform iOS \ --cache-builds --no-use-binaries \ --log-path build/carthage.log \