Skip to content

Commit 08fea87

Browse files
authored
Merge pull request #39 from typelift/swift-develop
Update to Swift 3.0
2 parents ff32568 + 43bc116 commit 08fea87

33 files changed

+517
-918
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Xcode
22
.DS_Store
3+
.build/*
34
build/
45
*.pbxuser
56
!default.pbxuser

.travis.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ matrix:
55
include:
66
- os: osx
77
language: objective-c
8-
osx_image: xcode7.3
8+
osx_image: xcode8
99
before_install:
1010
- git submodule update --init --recursive
1111
script:
@@ -14,15 +14,15 @@ matrix:
1414
- carthage build --no-skip-current
1515
- os: osx
1616
language: objective-c
17-
osx_image: xcode7.3
17+
osx_image: xcode8
1818
before_install:
1919
- git submodule update --init --recursive
2020
script:
2121
- set -o pipefail
2222
- xcodebuild test -scheme Concurrent | xcpretty -c
2323
# !!!: Make sure desired device name & OS version are suitable for the Xcode version installed on osx_image
24-
- iOS_DEVICE_NAME="iPad Pro"
25-
- iOS_RUNTIME_VERSION="9.3"
24+
- iOS_DEVICE_NAME="iPad Pro (12.9 inch)"
25+
- iOS_RUNTIME_VERSION="10.0"
2626
# Get simulator identifier for desired device/runtime pair
2727
- SIMULATOR_ID=$(xcrun instruments -s | grep -o "${iOS_DEVICE_NAME} (${iOS_RUNTIME_VERSION}) \[.*\]" | grep -o "\[.*\]" | sed "s/^\[\(.*\)\]$/\1/")
2828
- echo $SIMULATOR_ID
@@ -37,12 +37,11 @@ matrix:
3737
before_install:
3838
- git submodule update --init --recursive
3939
- wget -q -O - https://swift.org/keys/all-keys.asc | gpg --import -
40-
- wget https://swift.org/builds/swift-2.2.1-release/ubuntu1404/swift-2.2.1-RELEASE/swift-2.2.1-RELEASE-ubuntu14.04.tar.gz
41-
- tar xzf swift-2.2.1-RELEASE-ubuntu14.04.tar.gz
42-
- export PATH=${PWD}/swift-2.2.1-RELEASE-ubuntu14.04/usr/bin:"${PATH}"
40+
- wget https://swift.org/builds/swift-3.0-release/ubuntu1404/swift-3.0-RELEASE/swift-3.0-RELEASE-ubuntu14.04.tar.gz
41+
- tar xzf swift-3.0-RELEASE-ubuntu14.04.tar.gz
42+
- export PATH=${PWD}/swift-3.0-RELEASE-ubuntu14.04/usr/bin:"${PATH}"
4343
script:
44-
# Uncomment when releasing Swift 3.0
45-
# - swift build
44+
- swift build
4645
notifications:
4746
webhooks:
4847
urls:

Cartfile.private

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github "typelift/SwiftCheck"
1+
github "typelift/SwiftCheck"

Cartfile.resolved

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github "typelift/SwiftCheck" "v0.6.2"
1+
github "typelift/SwiftCheck" "v0.7.0"

Concurrent.xcodeproj/project.pbxproj

Lines changed: 28 additions & 74 deletions
Large diffs are not rendered by default.

Package.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import PackageDescription
2+
3+
let package = Package(
4+
name: "Concurrent",
5+
targets: [
6+
Target(
7+
name: "Concurrent",
8+
dependencies: []),
9+
]
10+
)
11+

Sources/CONCRealWorld.h

Lines changed: 0 additions & 25 deletions
This file was deleted.

Sources/CONCRealWorld.m

Lines changed: 0 additions & 79 deletions
This file was deleted.

Sources/Chan.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
// Copyright (c) 2014 TypeLift. All rights reserved.
77
//
88

9-
/// Channels are unbounded FIFO streams of values with a read and write terminals comprised of
10-
/// MVars.
9+
/// Channels are unbounded FIFO streams of values with a read and write
10+
/// terminals comprised of `MVar`s.
1111
public struct Chan<A> {
12-
let readEnd : MVar<MVar<ChItem<A>>>
13-
let writeEnd : MVar<MVar<ChItem<A>>>
12+
fileprivate let readEnd : MVar<MVar<ChItem<A>>>
13+
fileprivate let writeEnd : MVar<MVar<ChItem<A>>>
1414

1515
private init(read : MVar<MVar<ChItem<A>>>, write: MVar<MVar<ChItem<A>>>) {
1616
self.readEnd = read
@@ -40,7 +40,7 @@ public struct Chan<A> {
4040
}
4141

4242
/// Writes a value to a channel.
43-
public func write(x : A) {
43+
public func write(_ x : A) {
4444
self.writeEnd.modify_ { old_hole in
4545
let new_hole : MVar<ChItem<A>> = MVar()
4646
old_hole.put(ChItem(x, new_hole))
@@ -49,7 +49,7 @@ public struct Chan<A> {
4949
}
5050

5151
/// Writes a list of values to a channel.
52-
public func writeList(xs : [A]) {
52+
public func writeList(_ xs : [A]) {
5353
xs.forEach(self.write)
5454
}
5555

@@ -91,11 +91,11 @@ public struct Chan<A> {
9191
}
9292
}
9393

94-
internal struct ChItem<A> {
94+
private struct ChItem<A> {
9595
let val : () -> A
9696
let stream : () -> MVar<ChItem<A>>
9797

98-
init(@autoclosure(escaping) _ val : () -> A, @autoclosure(escaping) _ stream : () -> MVar<ChItem<A>>) {
98+
init(_ val : @autoclosure @escaping () -> A, _ stream : @autoclosure @escaping () -> MVar<ChItem<A>>) {
9999
self.val = val
100100
self.stream = stream
101101
}

0 commit comments

Comments
 (0)