Skip to content

Commit

Permalink
Update to swift 4.0.2 (#22)
Browse files Browse the repository at this point in the history
* Update to swift 4.0.2

* Update migrate .travis.yml to swift4.0.2
  • Loading branch information
ddunn2 authored and Aaron Liberatore committed Nov 21, 2017
1 parent 312fd9a commit abfaf1a
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.build
build
.vagrant
Packages
Package*
*.pkg
Kitura-WebSocket.xcodeproj
*.DS_Store
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.1
4.0.2
10 changes: 1 addition & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,9 @@ matrix:
- os: linux
dist: trusty
sudo: required
- os: linux
dist: trusty
sudo: required
env: SWIFT_SNAPSHOT=$SWIFT_4_DEV_SNAPSHOT
- os: osx
osx_image: xcode8.3
sudo: required
- os: osx
osx_image: xcode9
osx_image: xcode9.1
sudo: required
env: SWIFT_SNAPSHOT=$SWIFT_4_DEV_SNAPSHOT

before_install:
- git clone https://github.com/IBM-Swift/Package-Builder.git
Expand Down
5 changes: 0 additions & 5 deletions Package.pins

This file was deleted.

28 changes: 25 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// swift-tools-version:4.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

/**
* Copyright IBM Corporation 2016, 2017
*
Expand All @@ -18,8 +21,27 @@ import PackageDescription

let package = Package(
name: "Kitura-WebSocket",
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "Kitura-WebSocket",
targets: ["KituraWebSocket"]),
],
dependencies: [
.Package(url: "https://github.com/IBM-Swift/Kitura-net.git", majorVersion: 1, minor: 7),
.Package(url: "https://github.com/IBM-Swift/BlueCryptor.git", majorVersion: 0, minor: 8)
]
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(url: "https://github.com/IBM-Swift/Kitura-net.git", .upToNextMinor(from: "2.0.0")),
.package(url: "https://github.com/IBM-Swift/BlueCryptor.git", .upToNextMinor(from: "0.8.0")),

],
targets: [
// Targets are the basic building blocks of a package. A target defines a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "KituraWebSocket",
dependencies: ["KituraNet", "Cryptor"]),
.testTarget(
name: "KituraWebSocketTests",
dependencies: ["KituraWebSocket"]),
]
)
47 changes: 0 additions & 47 deletions Package@swift-4.swift

This file was deleted.

4 changes: 2 additions & 2 deletions Tests/KituraWebSocketTests/BasicTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ class BasicTests: KituraTest {
var text = "Testing, testing 1, 2, 3."
repeat {
text += " " + text
} while text.characters.count < 100000
} while text.count < 100000
let textPayload = self.payload(text: text)

self.performTest(framesToSend: [(true, self.opcodeText, textPayload)],
Expand All @@ -288,7 +288,7 @@ class BasicTests: KituraTest {
var text = ""
repeat {
text += "Testing, testing 1,2,3. "
} while text.characters.count < 1000
} while text.count < 1000
let textPayload = self.payload(text: text)

self.performTest(framesToSend: [(true, self.opcodeText, textPayload)],
Expand Down
2 changes: 1 addition & 1 deletion Tests/KituraWebSocketTests/ComplexTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class ComplexTests: KituraTest {
var mediumText = ""
repeat {
mediumText += "Testing, testing 1,2,3. "
} while mediumText.characters.count < 1000
} while mediumText.count < 1000
let mediumTextPayload = self.payload(text: mediumText)

let textExpectedPayload = self.payload(text: shortText + mediumText)
Expand Down
4 changes: 2 additions & 2 deletions Tests/KituraWebSocketTests/TestWebSocketService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class TestWebSocketService: WebSocketService {
connectionId = connection.id

if let pingMessage = pingMessage {
if pingMessage.characters.count > 0 {
if pingMessage.count > 0 {
connection.ping(withMessage: pingMessage)
}
else {
Expand Down Expand Up @@ -89,7 +89,7 @@ class TestWebSocketService: WebSocketService {
}

public func received(message: String, from: WebSocketConnection) {
print("Received a String message of length \(message.characters.count)")
print("Received a String message of length \(message.count)")
from.send(message: message)

if message == "close" {
Expand Down

0 comments on commit abfaf1a

Please sign in to comment.