From b9344643cc326ac862470dfe88e8c757aa0350b6 Mon Sep 17 00:00:00 2001 From: David Jones Date: Fri, 28 Sep 2018 16:47:34 +0100 Subject: [PATCH] Update to full Swift 4.2 mode (#1340) --- .swift-version | 2 +- .travis.yml | 17 ++++++------ Package.swift | 2 +- Package@swift-4.0.swift | 58 +++++++++++++++++++++++++++++++++++++++++ Package@swift-4.1.swift | 58 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 126 insertions(+), 11 deletions(-) create mode 100644 Package@swift-4.0.swift create mode 100644 Package@swift-4.1.swift diff --git a/.swift-version b/.swift-version index 4d0dcda01..bf77d5496 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -4.1.2 +4.2 diff --git a/.travis.yml b/.travis.yml index e0387529b..7069a3674 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,24 +25,24 @@ matrix: - os: linux dist: trusty sudo: required + env: SWIFT_SNAPSHOT=4.1.3 - os: linux dist: trusty sudo: required - services: docker - env: DOCKER_IMAGE=ubuntu:16.04 - os: linux dist: trusty sudo: required - services: docker - env: DOCKER_IMAGE=ubuntu:16.04 KITURA_NIO=1 + env: KITURA_NIO=1 - os: linux dist: trusty sudo: required - env: SWIFT_SNAPSHOT=4.2 + services: docker + env: DOCKER_IMAGE=ubuntu:16.04 - os: linux dist: trusty sudo: required - env: SWIFT_SNAPSHOT=4.2 KITURA_NIO=1 + services: docker + env: DOCKER_IMAGE=ubuntu:16.04 KITURA_NIO=1 - os: osx osx_image: xcode9.2 sudo: required @@ -50,15 +50,14 @@ matrix: - os: osx osx_image: xcode9.4 sudo: required - env: JAZZY_ELIGIBLE=true + env: SWIFT_SNAPSHOT=4.1.2 JAZZY_ELIGIBLE=true - os: osx osx_image: xcode10 sudo: required - env: SWIFT_SNAPSHOT=4.2 - os: osx osx_image: xcode10 sudo: required - env: SWIFT_SNAPSHOT=4.2 KITURA_NIO=1 + env: KITURA_NIO=1 before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update && brew install libressl ; fi diff --git a/Package.swift b/Package.swift index 587142eca..ce39829d1 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:4.0 +// swift-tools-version:4.2 // The swift-tools-version declares the minimum version of Swift required to build this package. /** diff --git a/Package@swift-4.0.swift b/Package@swift-4.0.swift new file mode 100644 index 000000000..587142eca --- /dev/null +++ b/Package@swift-4.0.swift @@ -0,0 +1,58 @@ +// 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 +import Foundation + +var kituraNetPackage: Package.Dependency + +if ProcessInfo.processInfo.environment["KITURA_NIO"] != nil { + kituraNetPackage = .package(url: "https://github.com/IBM-Swift/Kitura-NIO.git", from: "1.0.0") +} else { + kituraNetPackage = .package(url: "https://github.com/IBM-Swift/Kitura-net.git", from: "2.1.0") +} + +let package = Package( + name: "Kitura", + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .library( + name: "Kitura", + targets: ["Kitura"] + ) + ], + dependencies: [ + kituraNetPackage, + .package(url: "https://github.com/IBM-Swift/Kitura-TemplateEngine.git", from: "2.0.0"), + .package(url: "https://github.com/IBM-Swift/KituraContracts.git", from: "1.0.0"), + .package(url: "https://github.com/IBM-Swift/TypeDecoder.git", from: "1.1.0") + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define 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: "Kitura", + dependencies: ["KituraNet", "KituraTemplateEngine", "KituraContracts", "TypeDecoder"] + ), + .testTarget( + name: "KituraTests", + dependencies: ["Kitura", "KituraContracts", "TypeDecoder"] + ) + ] +) diff --git a/Package@swift-4.1.swift b/Package@swift-4.1.swift new file mode 100644 index 000000000..587142eca --- /dev/null +++ b/Package@swift-4.1.swift @@ -0,0 +1,58 @@ +// 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 +import Foundation + +var kituraNetPackage: Package.Dependency + +if ProcessInfo.processInfo.environment["KITURA_NIO"] != nil { + kituraNetPackage = .package(url: "https://github.com/IBM-Swift/Kitura-NIO.git", from: "1.0.0") +} else { + kituraNetPackage = .package(url: "https://github.com/IBM-Swift/Kitura-net.git", from: "2.1.0") +} + +let package = Package( + name: "Kitura", + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .library( + name: "Kitura", + targets: ["Kitura"] + ) + ], + dependencies: [ + kituraNetPackage, + .package(url: "https://github.com/IBM-Swift/Kitura-TemplateEngine.git", from: "2.0.0"), + .package(url: "https://github.com/IBM-Swift/KituraContracts.git", from: "1.0.0"), + .package(url: "https://github.com/IBM-Swift/TypeDecoder.git", from: "1.1.0") + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define 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: "Kitura", + dependencies: ["KituraNet", "KituraTemplateEngine", "KituraContracts", "TypeDecoder"] + ), + .testTarget( + name: "KituraTests", + dependencies: ["Kitura", "KituraContracts", "TypeDecoder"] + ) + ] +)