Skip to content

Commit

Permalink
Remove support for Swift 5.0 and 5.1 (#138)
Browse files Browse the repository at this point in the history
Changes made:

Removed CI config for 5.0 ad 5.1
Changed 5.2 to be based on 16.04 so we have some coverage there
Converted Package.swift to the latest syntax
Added a description to supported Swift versions in the README
  • Loading branch information
Davidde94 authored Jun 22, 2021
1 parent 79c0d26 commit c67aa04
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 58 deletions.
93 changes: 76 additions & 17 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.0
// swift-tools-version:5.2
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
Expand All @@ -16,22 +16,81 @@
import PackageDescription

var targets: [PackageDescription.Target] = [
.target(name: "NIOExtras", dependencies: ["NIO"]),
.target(name: "NIOHTTPCompression", dependencies: ["NIO", "NIOHTTP1", "CNIOExtrasZlib"]),
.target(name: "HTTPServerWithQuiescingDemo", dependencies: ["NIOExtras", "NIOHTTP1"]),
.target(name: "NIOWritePCAPDemo", dependencies: ["NIO", "NIOExtras", "NIOHTTP1"]),
.target(name: "NIOWritePartialPCAPDemo", dependencies: ["NIO", "NIOExtras", "NIOHTTP1"]),
.target(name: "NIOExtrasPerformanceTester", dependencies: ["NIO", "NIOExtras", "NIOHTTP1"]),
.target(name: "NIOSOCKS", dependencies: ["NIO"]),
.target(name: "NIOSOCKSClient", dependencies: ["NIO", "NIOSOCKS"]),
.target(name: "CNIOExtrasZlib",
dependencies: [],
linkerSettings: [
.linkedLibrary("z")
]),
.testTarget(name: "NIOExtrasTests", dependencies: ["NIOExtras", "NIO", "NIOTestUtils", "NIOConcurrencyHelpers"]),
.testTarget(name: "NIOHTTPCompressionTests", dependencies: ["NIOHTTPCompression"]),
.testTarget(name: "NIOSOCKSTests", dependencies: ["NIO", "NIOSOCKS"])
.target(
name: "NIOExtras",
dependencies: [
.product(name: "NIO", package: "swift-nio")
]),
.target(
name: "NIOHTTPCompression",
dependencies: [
"CNIOExtrasZlib",
.product(name: "NIO", package: "swift-nio"),
.product(name: "NIOHTTP1", package: "swift-nio"),
]),
.target(
name: "HTTPServerWithQuiescingDemo",
dependencies: [
"NIOExtras",
.product(name: "NIOHTTP1", package: "swift-nio"),
]),
.target(
name: "NIOWritePCAPDemo",
dependencies: [
"NIOExtras",
.product(name: "NIO", package: "swift-nio"),
.product(name: "NIOHTTP1", package: "swift-nio"),
]),
.target(
name: "NIOWritePartialPCAPDemo",
dependencies: [
"NIOExtras",
.product(name: "NIO", package: "swift-nio"),
.product(name: "NIOHTTP1", package: "swift-nio"),
]),
.target(
name: "NIOExtrasPerformanceTester",
dependencies: [
"NIOExtras",
.product(name: "NIO", package: "swift-nio"),
.product(name: "NIOHTTP1", package: "swift-nio"),
]),
.target(
name: "NIOSOCKS",
dependencies: [
.product(name: "NIO", package: "swift-nio")
]),
.target(
name: "NIOSOCKSClient",
dependencies: [
.product(name: "NIO", package: "swift-nio"),
"NIOSOCKS"
]),
.target(
name: "CNIOExtrasZlib",
dependencies: [],
linkerSettings: [
.linkedLibrary("z")
]),
.testTarget(
name: "NIOExtrasTests",
dependencies: [
"NIOExtras",
.product(name: "NIO", package: "swift-nio"),
.product(name: "NIOTestUtils", package: "swift-nio"),
.product(name: "NIOConcurrencyHelpers", package: "swift-nio"),
]),
.testTarget(
name: "NIOHTTPCompressionTests",
dependencies: [
"NIOHTTPCompression"
]),
.testTarget(
name: "NIOSOCKSTests",
dependencies: [
"NIOSOCKS",
.product(name: "NIO", package: "swift-nio"),
])
]

let package = Package(
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ All code will go through code review like in the other repositories related to t

`swift-nio-extras` part of the SwiftNIO 2 family of repositories and depends on the following:

- [`swift-nio`](https://github.com/apple/swift-nio), version 2.0.0 or better.
- Swift 5.0.
- [`swift-nio`](https://github.com/apple/swift-nio), version 2.29.0 or better.
- Swift 5.2.
- `zlib` and its development headers installed on the system. But don't worry, you'll find `zlib` on pretty much any UNIX system that can compile any sort of code.

To depend on `swift-nio-extras`, put the following in the `dependencies` of your `Package.swift`:
Expand All @@ -25,6 +25,8 @@ To depend on `swift-nio-extras`, put the following in the `dependencies` of your

### Support for older Swift versions

Earlier versions of SwiftNIO (2.29.x and lower) and SwiftNIOExtras (1.9.x and lower) supported Swift 5.0 and 5.1.

On the [`nio-extras-0.1`](https://github.com/apple/swift-nio-extras/tree/nio-extras-0.1) branch, you can find the `swift-nio-extras` version for the SwiftNIO 1 family. It requires Swift 4.1 or better.

## Current Contents
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG swift_version=5.0
ARG ubuntu_version=bionic
ARG swift_version=5.2
ARG ubuntu_version=focal
ARG base_image=swift:$swift_version-$ubuntu_version
FROM $base_image
# needed to do again after FROM due to docker limitation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ version: "3"
services:

runtime-setup:
image: swift-nio-extras:16.04-5.1
image: swift-nio-extras:16.04-5.2
build:
args:
ubuntu_version: "xenial"
swift_version: "5.1"
swift_version: "5.2"

test:
image: swift-nio-extras:16.04-5.1
image: swift-nio-extras:16.04-5.2
environment:
- SANITIZER_ARG=--sanitize=thread

shell:
image: swift-nio-extras:16.04-5.1
image: swift-nio-extras:16.04-5.2
16 changes: 0 additions & 16 deletions docker/docker-compose.1804.50.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions docker/docker-compose.1804.52.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/check_no_api_breakages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ for old_tag in "$@"; do
> "$report" 2>&1
fi

if ! shasum "$report" | grep -q cefc4ee5bb7bcdb7cb5a7747efa178dab3c794d5; then
if ! shasum "$report" | grep -q afd2a1b542b33273920d65821deddc653063c700; then
echo ERROR
echo >&2 "=============================="
echo >&2 "ERROR: public API change in $f"
Expand Down

0 comments on commit c67aa04

Please sign in to comment.