Skip to content

Commit 265c110

Browse files
Davidde94rolivieri
authored andcommitted
Updated to Swift 4.0 (Kitura#61)
* Updated to Swift 4 * Deleted Package.pins * Finalised conversion to Swift 4 only * Migration to Swift 4.0.2
1 parent d6626c0 commit 265c110

File tree

14 files changed

+45
-73
lines changed

14 files changed

+45
-73
lines changed

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
*.DS_Store
2-
*.pkg
3-
.build
4-
/SwiftRedis.xcodeproj
2+
.build/*
3+
.build-ubuntu/*
4+
*.xcodeproj/*
55
Package.resolved
66
Packages
7-
build
7+
build/*

.gitmodules

Whitespace-only changes.

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.1.1
1+
4.0.2

.travis.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,9 @@ matrix:
1414
- os: linux
1515
dist: trusty
1616
sudo: required
17-
- os: linux
18-
dist: trusty
19-
sudo: required
20-
env: SWIFT_SNAPSHOT=$SWIFT_4_DEV_SNAPSHOT
21-
- os: osx
22-
osx_image: xcode8.3
23-
sudo: required
2417
- os: osx
25-
osx_image: xcode9
18+
osx_image: xcode9.1
2619
sudo: required
27-
env: SWIFT_SNAPSHOT=$SWIFT_4_DEV_SNAPSHOT
2820

2921
before_install:
3022
- git clone https://github.com/IBM-Swift/Kitura-CI.git

Package.pins

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

Package.swift

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// swift-tools-version:4.0
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
14
/**
25
* Copyright IBM Corporation 2016, 2017
36
*
@@ -18,7 +21,25 @@ import PackageDescription
1821

1922
let package = Package(
2023
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+
],
2130
dependencies: [
22-
.Package(url: "https://github.com/IBM-Swift/BlueSocket.git", majorVersion: 0, minor: 12)
23-
]
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: "0.12.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+
]
2445
)

[email protected]

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

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ KituraRedis is a Swift library for interacting with a Redis database using.
88

99
It is dependent on the [BlueSocket](https://github.com/IBM-Swift/BlueSocket.git) module.
1010

11+
## Swift version
12+
The latest version of Kitura-redis requires **Swift 4.0.2**. You can download this version of the Swift binaries by following this [link](https://swift.org/download/). Compatibility with other Swift versions is not guaranteed.
13+
1114
## Build:
1215

1316
- `swift build`

Sources/.swift-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

Sources/SwiftRedis/RedisInfo.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ public struct RedisInfo {
4040
for val in strArray {
4141
let pos = val.range(of: ":")
4242
if let pos = pos {
43-
parsedInfo[val.substring(to: pos.lowerBound)] = val.substring(from: pos.upperBound)
43+
let key = String(val[..<pos.lowerBound])
44+
let value = val[pos.upperBound...]
45+
parsedInfo[key] = String(value)
4446
}
4547
}
4648

0 commit comments

Comments
 (0)