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

Swift 3 Support #62

Merged
merged 27 commits into from
Sep 12, 2016
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
20790c6
Gets ReactiveCocoa to compile with Swift 3 in Xcode 8.
mattprowse Jun 26, 2016
79ae0d4
Renamed TaskError.POSIXError to TaskError.posixError.
mattprowse Jun 27, 2016
95fd23a
Fix typo in NSPOSIXErrorDomain.
mattprowse Jun 27, 2016
0f70cce
Add `let _ =` to get rid of unused result warnings.
mattprowse Jun 28, 2016
6efac00
Minor refactoring.
mattprowse Jun 28, 2016
0a7cf6d
Updated test spec for Swift 3.
mattprowse Jun 28, 2016
004a0db
Update ReactiveCocoa.
mattprowse Jun 28, 2016
a654733
Clean up extraneous spaces at the beginning of functions caused by th…
mattprowse Jun 30, 2016
b474051
Merge upstream changes.
mattprowse Jul 4, 2016
2d51316
Track new ReactiveCocoa Swift 3 development branch.
mattprowse Jul 4, 2016
9357c96
The "should launch a task with standard input" test now passes.
mattprowse Jul 5, 2016
e81cd5c
Make Travis CI use Xcode 8.
mattprowse Jul 5, 2016
c341ba9
Updated ReactiveCocoa.
mattprowse Jul 12, 2016
403ba55
Merge upstream changes.
mattprowse Jul 12, 2016
54672bc
Xcode 8 beta 3 changes.
mattprowse Jul 19, 2016
dedbeaf
Merge upstream changes.
mattprowse Aug 2, 2016
24d89a3
Xcode 8 beta 4 changes.
mattprowse Aug 4, 2016
585cbdd
Tracking ReactiveCocoa changes.
mattprowse Aug 5, 2016
e15a1c4
Update dependencies.
mattprowse Aug 8, 2016
e373dae
Set deployment target back to 10.9.
mattprowse Aug 8, 2016
d31b40b
Update ReactiveCocoa.
mattprowse Aug 12, 2016
6c103aa
Changes for Xcode 8 beta 6 compatibility.
mattprowse Aug 18, 2016
1938e96
Update dependencies.
mattprowse Aug 23, 2016
1d27a95
Replace use of DispatchData(bytesNoCopy:deallocator:) with DispatchDa…
mattprowse Aug 23, 2016
5643f8c
Update dependencies for Xcode 8 GM compatibility.
mattprowse Sep 8, 2016
a044039
Update documentation for Swift 3.
mattprowse Sep 8, 2016
e597cb6
Remove commented out code.
mattprowse Sep 12, 2016
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
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[submodule "Carthage/Checkouts/Nimble"]
path = Carthage/Checkouts/Nimble
url = https://github.com/Quick/Nimble.git
url = https://github.com/norio-nomura/Nimble.git
[submodule "Carthage/Checkouts/Quick"]
path = Carthage/Checkouts/Quick
url = https://github.com/Quick/Quick.git
url = https://github.com/norio-nomura/Quick.git
[submodule "Carthage/Checkouts/Result"]
path = Carthage/Checkouts/Result
url = https://github.com/antitypical/Result.git
url = https://github.com/liscio/Result.git
[submodule "Carthage/Checkouts/xcconfigs"]
path = Carthage/Checkouts/xcconfigs
url = https://github.com/jspahrsummers/xcconfigs.git
Expand Down
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "ReactiveCocoa/ReactiveCocoa" ~> 4.2
github "ReactiveCocoa/ReactiveCocoa" "RAC5-swift3"
6 changes: 3 additions & 3 deletions Cartfile.private
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "Quick/Quick" ~> 0.9.2
github "Quick/Nimble" ~> 4.0
github "jspahrsummers/xcconfigs" ~> 0.9
github "norio-nomura/Quick" "nn-swift-3-compatibility"
github "norio-nomura/Nimble" "nn-swift-3-compatibility"
github "jspahrsummers/xcconfigs" ~> 0.9
8 changes: 4 additions & 4 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github "Quick/Nimble" "v4.0.0"
github "Quick/Quick" "v0.9.2"
github "antitypical/Result" "2.0.0"
github "norio-nomura/Nimble" "fd248426eb8692b4616c2b842fcb9a2579b964e8"
github "norio-nomura/Quick" "d3980a8bbafb13a973cb3018490e6577ee8307fd"
github "liscio/Result" "e96316e6afabd5e1f1389571babc3cfee5edb5b9"
github "jspahrsummers/xcconfigs" "0.9"
github "ReactiveCocoa/ReactiveCocoa" "v4.2.0"
github "ReactiveCocoa/ReactiveCocoa" "538cec3cf7b2f2efeff2e559ee5bc2eb4d033989"
2 changes: 1 addition & 1 deletion Carthage/Checkouts/Nimble
2 changes: 1 addition & 1 deletion Carthage/Checkouts/Quick
Submodule Quick updated from dc2b4b to d3980a
2 changes: 1 addition & 1 deletion Carthage/Checkouts/ReactiveCocoa
Submodule ReactiveCocoa updated 50 files
+3 −3 .gitmodules
+8 −1 .travis.yml
+1 −1 Cartfile
+2 −2 Cartfile.private
+3 −3 Cartfile.resolved
+1 −1 Carthage/Checkouts/Nimble
+1 −1 Carthage/Checkouts/Quick
+1 −1 Carthage/Checkouts/Result
+20 −20 ReactiveCocoa.playground/Pages/SignalProducer.xcplaygroundpage/Contents.swift
+3 −3 ReactiveCocoa.playground/Sources/PlaygroundUtility.swift
+458 −466 ReactiveCocoa.xcodeproj/project.pbxproj
+0 −8 ReactiveCocoa/Objective-C/RACDynamicPropertySuperclass.h
+0 −22 ReactiveCocoa/Objective-C/RACDynamicPropertySuperclass.m
+0 −1 ReactiveCocoa/ReactiveCocoa.h
+20 −20 ReactiveCocoa/Swift/Action.swift
+9 −6 ReactiveCocoa/Swift/Atomic.swift
+10 −5 ReactiveCocoa/Swift/Bag.swift
+8 −8 ReactiveCocoa/Swift/CocoaAction.swift
+12 −21 ReactiveCocoa/Swift/Disposable.swift
+68 −28 ReactiveCocoa/Swift/DynamicProperty.swift
+38 −38 ReactiveCocoa/Swift/Event.swift
+31 −31 ReactiveCocoa/Swift/EventLogger.swift
+195 −189 ReactiveCocoa/Swift/Flatten.swift
+6 −6 ReactiveCocoa/Swift/FoundationExtensions.swift
+45 −46 ReactiveCocoa/Swift/ObjectiveCBridging.swift
+35 −15 ReactiveCocoa/Swift/Observer.swift
+14 −0 ReactiveCocoa/Swift/Optional.swift
+431 −68 ReactiveCocoa/Swift/Property.swift
+113 −77 ReactiveCocoa/Swift/Scheduler.swift
+220 −257 ReactiveCocoa/Swift/Signal.swift
+144 −221 ReactiveCocoa/Swift/SignalProducer.swift
+8 −8 ReactiveCocoa/Swift/TupleExtensions.swift
+19 −1 ReactiveCocoaTests/Objective-C/RACKVOProxySpec.m
+2 −2 ReactiveCocoaTests/Swift/ActionSpec.swift
+1 −1 ReactiveCocoaTests/Swift/AtomicSpec.swift
+5 −5 ReactiveCocoaTests/Swift/CocoaActionSpec.swift
+71 −42 ReactiveCocoaTests/Swift/FlattenSpec.swift
+7 −7 ReactiveCocoaTests/Swift/FoundationExtensionsSpec.swift
+19 −17 ReactiveCocoaTests/Swift/ObjectiveCBridgingSpec.swift
+809 −48 ReactiveCocoaTests/Swift/PropertySpec.swift
+40 −45 ReactiveCocoaTests/Swift/SchedulerSpec.swift
+4 −4 ReactiveCocoaTests/Swift/SignalLifetimeSpec.swift
+63 −63 ReactiveCocoaTests/Swift/SignalProducerLiftingSpec.swift
+6 −6 ReactiveCocoaTests/Swift/SignalProducerNimbleMatchers.swift
+178 −157 ReactiveCocoaTests/Swift/SignalProducerSpec.swift
+227 −79 ReactiveCocoaTests/Swift/SignalSpec.swift
+4 −4 ReactiveCocoaTests/Swift/TestError.swift
+3 −3 ReactiveCocoaTests/Swift/TestLogger.swift
+6 −0 script/build
+6 −1 script/validate-playground.sh
18 changes: 14 additions & 4 deletions ReactiveTask.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,11 @@
TargetAttributes = {
D0BFEA571A2D1E5E00E23194 = {
CreatedOnToolsVersion = 6.1.1;
LastSwiftMigration = 0800;
};
D0BFEA621A2D1E5E00E23194 = {
CreatedOnToolsVersion = 6.1.1;
LastSwiftMigration = 0800;
};
};
};
Expand Down Expand Up @@ -351,7 +353,7 @@
CURRENT_PROJECT_VERSION = 1;
ENABLE_TESTABILITY = YES;
GCC_NO_COMMON_BLOCKS = YES;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MACOSX_DEPLOYMENT_TARGET = 10.10;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RAC target was switched back to 10.9. Can we keep this at 10.9 too?

ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
VERSIONING_SYSTEM = "apple-generic";
Expand All @@ -365,7 +367,7 @@
buildSettings = {
CURRENT_PROJECT_VERSION = 1;
GCC_NO_COMMON_BLOCKS = YES;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MACOSX_DEPLOYMENT_TARGET = 10.10;
SDKROOT = macosx;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand All @@ -382,6 +384,7 @@
INFOPLIST_FILE = ReactiveTask/Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = "org.carthage.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
Expand All @@ -395,6 +398,7 @@
INFOPLIST_FILE = ReactiveTask/Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = "org.carthage.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Release;
};
Expand All @@ -409,6 +413,7 @@
INFOPLIST_FILE = ReactiveTaskTests/Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = "org.carthage.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
Expand All @@ -423,6 +428,7 @@
INFOPLIST_FILE = ReactiveTaskTests/Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = "org.carthage.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Release;
};
Expand All @@ -432,7 +438,7 @@
buildSettings = {
CURRENT_PROJECT_VERSION = 1;
GCC_NO_COMMON_BLOCKS = YES;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MACOSX_DEPLOYMENT_TARGET = 10.10;
SDKROOT = macosx;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand All @@ -449,6 +455,7 @@
INFOPLIST_FILE = ReactiveTask/Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = "org.carthage.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Test;
};
Expand All @@ -463,6 +470,7 @@
INFOPLIST_FILE = ReactiveTaskTests/Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = "org.carthage.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Test;
};
Expand All @@ -472,7 +480,7 @@
buildSettings = {
CURRENT_PROJECT_VERSION = 1;
GCC_NO_COMMON_BLOCKS = YES;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MACOSX_DEPLOYMENT_TARGET = 10.10;
SDKROOT = macosx;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand All @@ -489,6 +497,7 @@
INFOPLIST_FILE = ReactiveTask/Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = "org.carthage.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Profile;
};
Expand All @@ -503,6 +512,7 @@
INFOPLIST_FILE = ReactiveTaskTests/Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = "org.carthage.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Profile;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
enableThreadSanitizer = "YES"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to leave this on?

debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
Expand Down
14 changes: 7 additions & 7 deletions ReactiveTask/Errors.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,37 @@ import Foundation
import ReactiveCocoa

/// An error originating from ReactiveTask.
public enum TaskError: ErrorType, Equatable {
public enum TaskError: ErrorProtocol, Equatable {
/// A shell task exited unsuccessfully.
case ShellTaskFailed(Task, exitCode: Int32, standardError: String?)
case shellTaskFailed(Task, exitCode: Int32, standardError: String?)

/// An error was returned from a POSIX API.
case POSIXError(Int32)
case posixError(Int32)
}

extension TaskError: CustomStringConvertible {
public var description: String {
switch self {
case let .ShellTaskFailed(task, exitCode, standardError):
case let .shellTaskFailed(task, exitCode, standardError):
var description = "A shell task (\(task)) failed with exit code \(exitCode)"
if let standardError = standardError {
description += ":\n\(standardError)"
}

return description

case let .POSIXError(code):
case let .posixError(code):
return NSError(domain: NSPOSIXErrorDomain, code: Int(code), userInfo: nil).description
}
}
}

public func == (lhs: TaskError, rhs: TaskError) -> Bool {
switch (lhs, rhs) {
case let (.ShellTaskFailed(lhsTask, lhsCode, lhsErr), .ShellTaskFailed(rhsTask, rhsCode, rhsErr)):
case let (.shellTaskFailed(lhsTask, lhsCode, lhsErr), .shellTaskFailed(rhsTask, rhsCode, rhsErr)):
return lhsTask == rhsTask && lhsCode == rhsCode && lhsErr == rhsErr

case let (.POSIXError(lhsCode), .POSIXError(rhsCode)):
case let (.posixError(lhsCode), .posixError(rhsCode)):
return lhsCode == rhsCode

default:
Expand Down
Loading