Skip to content

Commit cf052fd

Browse files
DunnCodingianpartridge
authored andcommitted
Support Swift 5 (#101)
1 parent 7029372 commit cf052fd

File tree

4 files changed

+73
-11
lines changed

4 files changed

+73
-11
lines changed

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.2.3
1+
5.0

.travis.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,22 @@ matrix:
2525
dist: xenial
2626
sudo: required
2727
services: docker
28-
env: DOCKER_IMAGE=swift:4.2.3 DOCKER_ENVIRONMENT="TESTDB_NAME" TESTDB_NAME=testdb_1604_1
28+
env: DOCKER_IMAGE=swift:4.2.4 SWIFT_SNAPSHOT=4.2.4 DOCKER_ENVIRONMENT="TESTDB_NAME" TESTDB_NAME=testdb_1604_1
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 DOCKER_ENVIRONMENT="TESTDB_NAME" TESTDB_NAME=testdb_1604_2
33+
env: DOCKER_IMAGE=swift:5.0-xenial DOCKER_ENVIRONMENT="TESTDB_NAME" TESTDB_NAME=testdb_1604_2
3434
- os: linux
3535
dist: xenial
3636
sudo: required
3737
services: docker
38-
env: DOCKER_IMAGE=swift:4.2.3 KITURA_NIO=1 DOCKER_ENVIRONMENT="TESTDB_NAME" TESTDB_NAME=testdb_1604_3
38+
env: DOCKER_IMAGE=swift:5.0-xenial KITURA_NIO=1 DOCKER_ENVIRONMENT="TESTDB_NAME" TESTDB_NAME=testdb_1604_3
3939
- os: linux
4040
dist: xenial
4141
sudo: required
4242
services: docker
43-
env: DOCKER_IMAGE=ubuntu:18.04 DOCKER_ENVIRONMENT="TESTDB_NAME" TESTDB_NAME=testdb_1804_1
43+
env: DOCKER_IMAGE=swift:5.0 SWIFT_SNAPSHOT=$SWIFT_DEVELOPMENT_SNAPSHOT DOCKER_ENVIRONMENT="TESTDB_NAME" TESTDB_NAME=testdb_1804_1
4444
- os: osx
4545
osx_image: xcode9.2
4646
sudo: required
@@ -52,15 +52,19 @@ matrix:
5252
- os: osx
5353
osx_image: xcode10.1
5454
sudo: required
55-
env: TESTDB_NAME=testdb_xcode10_1
55+
env: SWIFT_SNAPSHOT=4.2.1 TESTDB_NAME=testdb_xcode10_1
5656
- os: osx
57-
osx_image: xcode10.1
57+
osx_image: xcode10.2
5858
sudo: required
59-
env: SWIFT_SNAPSHOT=$SWIFT_DEVELOPMENT_SNAPSHOT TESTDB_NAME=testdb_xcode10_2
59+
env: TESTDB_NAME=testdb_xcode10_2
6060
- os: osx
61-
osx_image: xcode10.1
61+
osx_image: xcode10.2
6262
sudo: required
6363
env: KITURA_NIO=1 BREW_INSTALL_PACKAGES="libressl" TESTDB_NAME=testdb_xcode10_3
64+
- os: osx
65+
osx_image: xcode10.2
66+
sudo: required
67+
env: SWIFT_SNAPSHOT=$SWIFT_DEVELOPMENT_SNAPSHOT TESTDB_NAME=testdb_xcode10_4
6468

6569
before_install:
6670
- git clone https://github.com/IBM-Swift/Package-Builder.git

Package.swift

Lines changed: 2 additions & 2 deletions
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, 2017, 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.

Package@swift-4.swift

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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, 2017, 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+
import Foundation
22+
23+
var kituraNetPackage: Package.Dependency
24+
25+
if ProcessInfo.processInfo.environment["KITURA_NIO"] != nil {
26+
kituraNetPackage = .package(url: "https://github.com/IBM-Swift/Kitura-NIO.git", from: "1.0.0")
27+
} else {
28+
kituraNetPackage = .package(url: "https://github.com/IBM-Swift/Kitura-net.git", from: "2.1.0")
29+
}
30+
31+
let package = Package(
32+
name: "Kitura-CouchDB",
33+
products: [
34+
// Products define the executables and libraries produced by a package, and make them visible to other packages.
35+
.library(
36+
name: "CouchDB",
37+
targets: ["CouchDB"]),
38+
],
39+
dependencies: [
40+
// Dependencies declare other packages that this package depends on.
41+
// .package(url: /* package url */, from: "1.0.0"),
42+
.package(url: "https://github.com/IBM-Swift/LoggerAPI.git", from: "1.7.0"),
43+
kituraNetPackage,
44+
],
45+
targets: [
46+
// Targets are the basic building blocks of a package. A target defines a module or a test suite.
47+
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
48+
.target(
49+
name: "CouchDB",
50+
dependencies: ["LoggerAPI", "KituraNet"]),
51+
.target(
52+
name: "CouchDBSample",
53+
dependencies: ["CouchDB"]),
54+
.testTarget(
55+
name: "CouchDBTests",
56+
dependencies: ["CouchDB"]),
57+
]
58+
)

0 commit comments

Comments
 (0)