Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.0] Drop Xcode 8.3/Swift 3.1 support #252

Merged
merged 2 commits into from
Oct 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1
4.0
33 changes: 9 additions & 24 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
branches:
only:
- master

matrix:
include:
- script:
Expand All @@ -6,34 +10,13 @@ matrix:
- xcodebuild $XCODE_ACTION -scheme Result-iOS -sdk iphonesimulator -destination "name=iPhone SE" | xcpretty
- xcodebuild $XCODE_ACTION -scheme Result-tvOS -sdk appletvsimulator -destination "name=Apple TV 1080p" | xcpretty
- xcodebuild build -scheme Result-watchOS -sdk watchsimulator | xcpretty
# - pod lib lint
env:
- JOB=Xcode
- XCODE_ACTION="build-for-testing test-without-building"
os: osx
osx_image: xcode8.3
language: objective-c
- script:
- set -o pipefail
- xcodebuild $XCODE_ACTION -scheme Result-Mac | xcpretty
- xcodebuild $XCODE_ACTION -scheme Result-iOS -sdk iphonesimulator -destination "name=iPhone SE" | xcpretty
- xcodebuild $XCODE_ACTION -scheme Result-tvOS -sdk appletvsimulator -destination "name=Apple TV 1080p" | xcpretty
- xcodebuild build -scheme Result-watchOS -sdk watchsimulator | xcpretty
# - pod lib lint
- pod lib lint
env:
- JOB=Xcode
- XCODE_ACTION="build-for-testing test-without-building"
os: osx
osx_image: xcode9
language: objective-c
- script:
- swift --version
- swift build
- swift test
env: JOB=SPM
os: osx
osx_image: xcode8.3
language: objective-c
- script:
- swift --version
- swift build
Expand All @@ -46,7 +29,8 @@ matrix:
- swift --version
- swift build
- swift test
env: JOB=Linux
env:
- JOB=Linux
sudo: required
dist: trusty
language: generic
Expand All @@ -58,11 +42,12 @@ matrix:
- swift test
env:
- JOB=Linux
- SWIFT_VERSION=4.0-DEVELOPMENT-SNAPSHOT-2017-08-04-a
- SWIFT_VERSION=4.0-DEVELOPMENT-SNAPSHOT-2017-09-26-a
sudo: required
dist: trusty
language: generic
install:
- eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)"

notifications:
email: false
7 changes: 0 additions & 7 deletions Result/AnyError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ extension AnyError: CustomStringConvertible {

extension AnyError: LocalizedError {
public var errorDescription: String? {
#if !(swift(>=4.0) || os(macOS) || os(iOS) || os(tvOS) || os(watchOS))
// This workaround below is not needed for Swift 4.0 thanks to
// https://github.com/apple/swift-corelibs-foundation/pull/967.
if let nsError = error as? NSError {
return nsError.localizedDescription
}
#endif
return error.localizedDescription
}

Expand Down
6 changes: 3 additions & 3 deletions Tests/ResultTests/ResultTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

final class ResultTests: XCTestCase {
func testMapTransformsSuccesses() {
XCTAssertEqual(success.map { $0.characters.count } ?? 0, 7)
XCTAssertEqual(success.map { $0.count } ?? 0, 7)
}

func testMapRewrapsFailures() {
XCTAssertEqual(failure.map { $0.characters.count } ?? 0, 0)
XCTAssertEqual(failure.map { $0.count } ?? 0, 0)
}

func testInitOptionalSuccess() {
Expand Down Expand Up @@ -37,7 +37,7 @@ final class ResultTests: XCTestCase {

func testBimapTransformsSuccesses() {
XCTAssertEqual(success.bimap(
success: { $0.characters.count },
success: { $0.count },
failure: { $0 }
) ?? 0, 7)
}
Expand Down