diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c4109d5e..1bbf2f219 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: runs-on: macOS-10.14 strategy: matrix: - xcode: [10.1, 10.3, 11] + xcode: [10.3, 11] steps: - uses: actions/checkout@v1 - run: sudo xcode-select -s '/Applications/Xcode_${{ matrix.xcode }}.app' @@ -39,7 +39,7 @@ jobs: runs-on: macOS-10.14 strategy: matrix: - xcode: [10.1, 10.3, 11] + xcode: [10.3, 11] steps: - uses: actions/checkout@v1 - run: sudo xcode-select -s '/Applications/Xcode_${{ matrix.xcode }}.app' diff --git a/.swift-version b/.swift-version deleted file mode 100644 index bf77d5496..000000000 --- a/.swift-version +++ /dev/null @@ -1 +0,0 @@ -4.2 diff --git a/.travis.yml b/.travis.yml index 7d1047d12..2c7f350f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,24 +6,20 @@ language: generic matrix: include: - &swiftpm_linux - name: SwiftPM / Linux / Swift 4.2.4 + name: SwiftPM / Linux / Swift 5.0.3 os: linux dist: trusty sudo: required env: - - SWIFT_VERSION=4.2.4 + - SWIFT_VERSION=5.0.3 install: - eval "$(curl -sL https://swiftenv.fuller.li/install.sh)" script: - ./test swiftpm - - <<: *swiftpm_linux - name: SwiftPM / Linux / Swift 5.0.3 - env: - - SWIFT_VERSION=5.0.3 - <<: *swiftpm_linux name: SwiftPM / Linux / Swift 5.1 Development env: - - SWIFT_VERSION=5.1-DEVELOPMENT-SNAPSHOT-2019-09-05-a + - SWIFT_VERSION=5.1-DEVELOPMENT-SNAPSHOT-2019-09-09-a install: true script: - ./test $TYPE diff --git a/Gemfile.lock b/Gemfile.lock index 6c6f53490..690067edc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,18 +1,18 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.0) + CFPropertyList (3.0.1) activesupport (4.2.11.1) i18n (~> 0.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) atomos (0.1.3) - claide (1.0.2) - cocoapods (1.7.1) + claide (1.0.3) + cocoapods (1.7.5) activesupport (>= 4.0.2, < 5) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.7.1) + cocoapods-core (= 1.7.5) cocoapods-deintegrate (>= 1.0.3, < 2.0) cocoapods-downloader (>= 1.2.2, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0) @@ -22,13 +22,13 @@ GEM cocoapods-try (>= 1.1.0, < 2.0) colored2 (~> 3.1) escape (~> 0.0.4) - fourflusher (>= 2.2.0, < 3.0) + fourflusher (>= 2.3.0, < 3.0) gh_inspector (~> 1.0) molinillo (~> 0.6.6) nap (~> 1.0) ruby-macho (~> 1.4) - xcodeproj (>= 1.8.2, < 2.0) - cocoapods-core (1.7.1) + xcodeproj (>= 1.10.0, < 2.0) + cocoapods-core (1.7.5) activesupport (>= 4.0.2, < 6) fuzzy_match (~> 2.0.4) nap (~> 1.0) @@ -38,14 +38,14 @@ GEM nap cocoapods-search (1.0.0) cocoapods-stats (1.1.0) - cocoapods-trunk (1.3.1) + cocoapods-trunk (1.4.0) nap (>= 0.8, < 2.0) netrc (~> 0.11) cocoapods-try (1.1.0) colored2 (3.1.2) concurrent-ruby (1.1.5) escape (0.0.4) - fourflusher (2.3.0) + fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) i18n (0.9.5) @@ -59,7 +59,7 @@ GEM thread_safe (0.3.6) tzinfo (1.2.5) thread_safe (~> 0.1) - xcodeproj (1.9.0) + xcodeproj (1.12.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) diff --git a/Nimble.podspec b/Nimble.podspec index 754e2c1fe..ccd63dfc5 100644 --- a/Nimble.podspec +++ b/Nimble.podspec @@ -51,8 +51,8 @@ Pod::Spec.new do |s| s.cocoapods_version = '>= 1.4.0' if s.respond_to?(:swift_versions) then - s.swift_versions = ['4.2', '5.0'] + s.swift_versions = ['5.0'] else - s.swift_version = '4.2' + s.swift_version = '5.0' end end diff --git a/Nimble.xcodeproj/project.pbxproj b/Nimble.xcodeproj/project.pbxproj index 5179f22f5..dad271f6b 100644 --- a/Nimble.xcodeproj/project.pbxproj +++ b/Nimble.xcodeproj/project.pbxproj @@ -62,8 +62,6 @@ 1F1B5AD51963E13900CA8BF9 /* BeAKindOfTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F1B5AD31963E13900CA8BF9 /* BeAKindOfTest.swift */; }; 1F299EAB19627B2D002641AF /* BeEmptyTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F299EAA19627B2D002641AF /* BeEmptyTest.swift */; }; 1F299EAC19627B2D002641AF /* BeEmptyTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F299EAA19627B2D002641AF /* BeEmptyTest.swift */; }; - 1F43728A1A1B343800EB80F8 /* Functional.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FD8CD251968AB07008ED995 /* Functional.swift */; }; - 1F43728B1A1B343900EB80F8 /* Functional.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FD8CD251968AB07008ED995 /* Functional.swift */; }; 1F43728C1A1B343C00EB80F8 /* SourceLocation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FD8CD271968AB07008ED995 /* SourceLocation.swift */; }; 1F43728D1A1B343D00EB80F8 /* SourceLocation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FD8CD271968AB07008ED995 /* SourceLocation.swift */; }; 1F43728E1A1B343F00EB80F8 /* Stringers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FD8CD281968AB07008ED995 /* Stringers.swift */; }; @@ -142,7 +140,6 @@ 1F5DF1871BDCA0F500C3A531 /* Match.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDB4D5EC19FE43C200E9D9FE /* Match.swift */; }; 1F5DF1891BDCA0F500C3A531 /* RaisesException.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FD8CD1E1968AB07008ED995 /* RaisesException.swift */; }; 1F5DF18A1BDCA0F500C3A531 /* ThrowError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29EA59651B551EE6002D767E /* ThrowError.swift */; }; - 1F5DF18B1BDCA0F500C3A531 /* Functional.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FD8CD251968AB07008ED995 /* Functional.swift */; }; 1F5DF18C1BDCA0F500C3A531 /* Await.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FD8CD261968AB07008ED995 /* Await.swift */; }; 1F5DF18D1BDCA0F500C3A531 /* SourceLocation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FD8CD271968AB07008ED995 /* SourceLocation.swift */; }; 1F5DF18E1BDCA0F500C3A531 /* Stringers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FD8CD281968AB07008ED995 /* Stringers.swift */; }; @@ -588,7 +585,6 @@ 1FD8CD1C1968AB07008ED995 /* Equal.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = Equal.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; 1FD8CD1D1968AB07008ED995 /* MatcherProtocols.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MatcherProtocols.swift; sourceTree = ""; }; 1FD8CD1E1968AB07008ED995 /* RaisesException.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = RaisesException.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; - 1FD8CD251968AB07008ED995 /* Functional.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Functional.swift; sourceTree = ""; }; 1FD8CD261968AB07008ED995 /* Await.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Await.swift; sourceTree = ""; }; 1FD8CD271968AB07008ED995 /* SourceLocation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SourceLocation.swift; sourceTree = ""; }; 1FD8CD281968AB07008ED995 /* Stringers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Stringers.swift; sourceTree = ""; }; @@ -893,7 +889,6 @@ 1FD8CD241968AB07008ED995 /* Utils */ = { isa = PBXGroup; children = ( - 1FD8CD251968AB07008ED995 /* Functional.swift */, 1FD8CD261968AB07008ED995 /* Await.swift */, 1FD8CD271968AB07008ED995 /* SourceLocation.swift */, 1FD8CD281968AB07008ED995 /* Stringers.swift */, @@ -1335,7 +1330,6 @@ 1F43728D1A1B343D00EB80F8 /* SourceLocation.swift in Sources */, 1FD8CD4E1968AB07008ED995 /* BeLessThanOrEqual.swift in Sources */, 1FDBD8671AF8A4FF0089F27B /* AssertionDispatcher.swift in Sources */, - 1F43728A1A1B343800EB80F8 /* Functional.swift in Sources */, AE4BA9AD1C88DDB500B73906 /* Errors.swift in Sources */, 1FD8CD3C1968AB07008ED995 /* BeAnInstanceOf.swift in Sources */, 7A6AB2C51E7F628900A2F694 /* ToSucceed.swift in Sources */, @@ -1523,7 +1517,6 @@ 1F5DF1721BDCA0F500C3A531 /* Expectation.swift in Sources */, 7B5358C01C38479700A23FAA /* SatisfyAnyOf.swift in Sources */, 7B13BA0C1DD361D300C9098C /* ContainElementSatisfying.swift in Sources */, - 1F5DF18B1BDCA0F500C3A531 /* Functional.swift in Sources */, 1F5DF1871BDCA0F500C3A531 /* Match.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1615,7 +1608,6 @@ 1FD8CD4F1968AB07008ED995 /* BeLessThanOrEqual.swift in Sources */, 1F1871E71CA8A18400A34BF2 /* Async.swift in Sources */, 1FDBD8681AF8A4FF0089F27B /* AssertionDispatcher.swift in Sources */, - 1F43728B1A1B343900EB80F8 /* Functional.swift in Sources */, AE4BA9AE1C88DDB500B73906 /* Errors.swift in Sources */, 1FD8CD3D1968AB07008ED995 /* BeAnInstanceOf.swift in Sources */, 1FD8CD511968AB07008ED995 /* BeLogical.swift in Sources */, @@ -1853,7 +1845,7 @@ SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -1910,7 +1902,7 @@ SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; diff --git a/Package@swift-4.2.swift b/Package@swift-4.2.swift deleted file mode 100644 index 2c6c54574..000000000 --- a/Package@swift-4.2.swift +++ /dev/null @@ -1,30 +0,0 @@ -// swift-tools-version:4.2 -import PackageDescription - -let package = Package( - name: "Nimble", - products: [ - .library(name: "Nimble", targets: ["Nimble"]), - ], - dependencies: [ - .package(url: "https://github.com/mattgallagher/CwlPreconditionTesting.git", .exact("1.2.0")), - ], - targets: [ - .target( - name: "Nimble", - dependencies: { - #if os(macOS) - return ["CwlPreconditionTesting"] - #else - return [] - #endif - }() - ), - .testTarget( - name: "NimbleTests", - dependencies: ["Nimble"], - exclude: ["objc"] - ), - ], - swiftLanguageVersions: [.v4_2] -) diff --git a/README.md b/README.md index 4f7f89bcc..08c52d926 100644 --- a/README.md +++ b/README.md @@ -1660,11 +1660,11 @@ backported. The deprecating plan is a 3 major versions removal. Which is as follows: 1. Introduce new `Predicate` API, deprecation warning for old matcher APIs. - (Nimble `v7.x.x` and `v8.x.x`) + (Nimble `v7.x.x`, `v8.x.x` and `v9.x.x`) 2. Introduce warnings on migration-path features (`.predicate`, `Predicate`-constructors with similar arguments to old API). (Nimble - `v9.x.x`) - 3. Remove old API. (Nimble `v10.x.x`) + `v10.x.x`) + 3. Remove old API. (Nimble `v11.x.x`) # Installing Nimble diff --git a/Sources/Nimble/Adapters/NimbleXCTestHandler.swift b/Sources/Nimble/Adapters/NimbleXCTestHandler.swift index cd3b47608..5f2962879 100644 --- a/Sources/Nimble/Adapters/NimbleXCTestHandler.swift +++ b/Sources/Nimble/Adapters/NimbleXCTestHandler.swift @@ -45,7 +45,7 @@ class NimbleXCTestUnavailableHandler: AssertionHandler { private var stashed_swift_reportFatalErrorsToDebugger: Bool = false @objc func testCaseWillStart(_ testCase: XCTestCase) { - #if swift(>=3.2) && !os(tvOS) + #if os(macOS) || os(iOS) stashed_swift_reportFatalErrorsToDebugger = _swift_reportFatalErrorsToDebugger _swift_reportFatalErrorsToDebugger = false #endif @@ -56,7 +56,7 @@ class NimbleXCTestUnavailableHandler: AssertionHandler { @objc func testCaseDidFinish(_ testCase: XCTestCase) { currentTestCase = nil - #if swift(>=3.2) && !os(tvOS) + #if os(macOS) || os(iOS) _swift_reportFatalErrorsToDebugger = stashed_swift_reportFatalErrorsToDebugger #endif } diff --git a/Sources/Nimble/Utils/Await.swift b/Sources/Nimble/Utils/Await.swift index abe1237e5..dc8533c5c 100644 --- a/Sources/Nimble/Utils/Await.swift +++ b/Sources/Nimble/Utils/Await.swift @@ -257,11 +257,7 @@ internal class AwaitPromiseBuilder { self.trigger.timeoutSource.resume() while self.promise.asyncResult.isIncomplete() { // Stopping the run loop does not work unless we run only 1 mode - #if (swift(>=4.2) && canImport(Darwin)) || compiler(>=5.0) _ = RunLoop.current.run(mode: .default, before: .distantFuture) - #else - _ = RunLoop.current.run(mode: .defaultRunLoopMode, before: .distantFuture) - #endif } self.trigger.timeoutSource.cancel() diff --git a/Sources/Nimble/Utils/Functional.swift b/Sources/Nimble/Utils/Functional.swift deleted file mode 100644 index c87af761d..000000000 --- a/Sources/Nimble/Utils/Functional.swift +++ /dev/null @@ -1,14 +0,0 @@ -import Foundation - -#if !swift(>=4.2) -extension Sequence { - internal func allSatisfy(_ predicate: (Element) throws -> Bool) rethrows -> Bool { - for item in self { - if try !predicate(item) { - return false - } - } - return true - } -} -#endif diff --git a/test b/test index 3c17d810d..05afdb729 100755 --- a/test +++ b/test @@ -78,12 +78,8 @@ function test_podspec { echo "Gathering CocoaPods installation information..." run bundle exec pod --version echo "Linting podspec..." - # To work around the lint error: "ERROR | swift: Specification `Nimble` specifies an inconsistent `swift_version` (`4.0`) compared to the one present in your `.swift-version` file (`4.1`). Please remove the `.swift-version` file which is now deprecated and only use the `swift_version` attribute within your podspec." - # `.swift-version` is for swiftenv, not for CocoaPods, so we can't remove the file as suggested. - run mv .swift-version .swift-version.backup # Note: remove `--allow-warnings` once old Matcher API has been removed run bundle exec pod lib lint Nimble.podspec --allow-warnings --skip-import-validation - run mv .swift-version.backup .swift-version } function test_swiftpm {