From 8430a6aaeae622b34e6f75e671485ac9560b0f64 Mon Sep 17 00:00:00 2001 From: Alex Deem Date: Sun, 2 Jun 2024 10:46:28 +1000 Subject: [PATCH] Move to Swift 5.9 as the minimum version --- .github/workflows/ci.yml | 14 -------------- Package.swift | 13 ++++--------- .../ScreamURITemplate/Internal/Components.swift | 6 +----- Sources/ScreamURITemplate/URITemplate.swift | 4 +--- Tests/ScreamURITemplateTests/Tests.swift | 12 +++++------- 5 files changed, 11 insertions(+), 38 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f78f7dd..c9f6dbb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,17 +26,3 @@ jobs: with: fail_ci_if_error: true verbose: true - - build-5_4_2: - runs-on: macos-11 - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - name: Check Swift version - run: | - sudo xcode-select -s /Applications/Xcode_12.5.1.app/ - export TOOLCHAINS=swift - swift --version - - name: Run tests - run: swift test diff --git a/Package.swift b/Package.swift index f493b07..69d682c 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.4 +// swift-tools-version: 5.9 import PackageDescription @@ -31,13 +31,8 @@ let package = Package( .process("data/uritemplate-test/extended-tests.json"), .process("data/uritemplate-test/negative-tests.json"), ]), - ], - swiftLanguageVersions: [.v5]) - -#if swift(>=5.6) || os(macOS) || os(Linux) - package.targets.append( .executableTarget( name: "ScreamURITemplateExample", - dependencies: ["ScreamURITemplate"]) - ) -#endif + dependencies: ["ScreamURITemplate"]), + ], + swiftLanguageVersions: [.v5]) diff --git a/Sources/ScreamURITemplate/Internal/Components.swift b/Sources/ScreamURITemplate/Internal/Components.swift index 306ed03..299cc32 100644 --- a/Sources/ScreamURITemplate/Internal/Components.swift +++ b/Sources/ScreamURITemplate/Internal/Components.swift @@ -14,11 +14,7 @@ import Foundation -#if swift(>=5.5) - typealias ComponentBase = Sendable -#else - protocol ComponentBase {} -#endif +typealias ComponentBase = Sendable protocol Component: ComponentBase { func expand(variables: [String: VariableValue]) throws -> String diff --git a/Sources/ScreamURITemplate/URITemplate.swift b/Sources/ScreamURITemplate/URITemplate.swift index 8c31bc7..2b8cb34 100644 --- a/Sources/ScreamURITemplate/URITemplate.swift +++ b/Sources/ScreamURITemplate/URITemplate.swift @@ -53,9 +53,7 @@ public struct URITemplate { } } -#if swift(>=5.5) - extension URITemplate: Sendable {} -#endif +extension URITemplate: Sendable {} extension URITemplate: CustomStringConvertible { public var description: String { diff --git a/Tests/ScreamURITemplateTests/Tests.swift b/Tests/ScreamURITemplateTests/Tests.swift index dc447ba..51a7098 100644 --- a/Tests/ScreamURITemplateTests/Tests.swift +++ b/Tests/ScreamURITemplateTests/Tests.swift @@ -16,13 +16,11 @@ import ScreamURITemplate import XCTest class Tests: XCTestCase { - #if swift(>=5.5) - func testSendable() { - let template: URITemplate = "https://api.github.com/repos/{owner}/{repo}/collaborators/{username}" - let sendable = template as Sendable - XCTAssertNotNil(sendable) - } - #endif + func testSendable() { + let template: URITemplate = "https://api.github.com/repos/{owner}/{repo}/collaborators/{username}" + let sendable = template as Sendable + XCTAssertNotNil(sendable) + } func testCustomStringConvertible() { let template: URITemplate = "https://api.github.com/repos/{owner}/{repo}/collaborators/{username}"