Skip to content

Commit c9d45f6

Browse files
Support Swift 5 (#73)
1 parent be971be commit c9d45f6

File tree

5 files changed

+57
-8
lines changed

5 files changed

+57
-8
lines changed

.swift-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.2.3
1+
5.0

.travis.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ matrix:
2525
dist: xenial
2626
sudo: required
2727
services: docker
28-
env: DOCKER_IMAGE=swift:4.2.3
28+
env: DOCKER_IMAGE=swift:4.2.4 SWIFT_SNAPSHOT=4.2.4
2929
- os: linux
3030
dist: xenial
3131
sudo: required
3232
services: docker
33-
env: DOCKER_IMAGE=swift:4.2.3 SWIFT_SNAPSHOT=$SWIFT_DEVELOPMENT_SNAPSHOT
33+
env: DOCKER_IMAGE=swift:5.0-xenial
3434
- os: linux
3535
dist: xenial
3636
sudo: required
3737
services: docker
38-
env: DOCKER_IMAGE=ubuntu:18.04
38+
env: DOCKER_IMAGE=swift:5.0 SWIFT_SNAPSHOT=$SWIFT_DEVELOPMENT_SNAPSHOT
3939
- os: osx
4040
osx_image: xcode9.2
4141
sudo: required
@@ -47,8 +47,12 @@ matrix:
4747
- os: osx
4848
osx_image: xcode10.1
4949
sudo: required
50+
env: SWIFT_SNAPSHOT=4.2.1
5051
- os: osx
51-
osx_image: xcode10.1
52+
osx_image: xcode10.2
53+
sudo: required
54+
- os: osx
55+
osx_image: xcode10.2
5256
sudo: required
5357
env: SWIFT_SNAPSHOT=$SWIFT_DEVELOPMENT_SNAPSHOT
5458

Package.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
// swift-tools-version:4.0
1+
// swift-tools-version:5.0
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
/**
5-
* Copyright IBM Corporation 2016, 2017
5+
* Copyright IBM Corporation 2016-2019
66
*
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.

[email protected]

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// swift-tools-version:4.0
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
/**
5+
* Copyright IBM Corporation 2016-2019
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
**/
19+
20+
import PackageDescription
21+
22+
let package = Package(
23+
name: "SwiftRedis",
24+
products: [
25+
// Products define the executables and libraries produced by a package, and make them visible to other packages.
26+
.library(
27+
name: "SwiftRedis",
28+
targets: ["SwiftRedis"]),
29+
],
30+
dependencies: [
31+
// Dependencies declare other packages that this package depends on.
32+
// .package(url: /* package url */, from: "1.0.0"),
33+
.package(url: "https://github.com/IBM-Swift/BlueSocket.git", from: "1.0.0")
34+
],
35+
targets: [
36+
// Targets are the basic building blocks of a package. A target defines a module or a test suite.
37+
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
38+
.target(
39+
name: "SwiftRedis",
40+
dependencies: ["Socket"]),
41+
.testTarget(
42+
name: "SwiftRedisTests",
43+
dependencies: ["SwiftRedis"]),
44+
]
45+
)

Sources/SwiftRedis/RedisResp.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class RedisResp {
105105
} catch let error as Socket.Error {
106106
callback(RedisResponse.Error("Error reading from the Redis server. Error=\(error.description)"))
107107
} catch let error as RedisRespError {
108-
callback(RedisResponse.Error("Error reading from the Redis server. Error=\(error.description)"))
108+
callback(RedisResponse.Error("Error reading from the Redis server. Error=\(error.description())"))
109109
} catch {
110110
callback(RedisResponse.Error("Error reading from the Redis server. Unknown error"))
111111
}

0 commit comments

Comments
 (0)