Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Swift 4 support #20

Merged
merged 3 commits into from
Sep 25, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions Package@swift-4.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// 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
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/

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: [
// 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: "1.7.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: ["Kitura-net", "Cryptor"]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be KituraNet instead

.testTarget(
name: "KituraWebSocketTests",
dependencies: ["KituraWebSocket"]),
]
)
6 changes: 5 additions & 1 deletion Tests/KituraWebSocketTests/PrintLogger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ public class PrintLogger: Logger {
guard let range = path.range(of: "/", options: .backwards) else {
return path
}
return path.substring(from: range.upperBound)
#if swift(>=3.2)
return String(path[range.upperBound...])
#else
return path.substring(from: range.upperBound)
#endif
}
}
2 changes: 1 addition & 1 deletion Tests/KituraWebSocketTests/TestLinuxSafeguard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
**/

#if os(OSX)
#if os(OSX) && !swift(>=3.2)
import XCTest

class TestLinuxSafeguard: XCTestCase {
Expand Down