Skip to content

Commit

Permalink
Move to Swift 5.9 as the minimum version
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdeem committed Jun 2, 2024
1 parent 5f693e8 commit 8430a6a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 38 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 4 additions & 9 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version: 5.4
// swift-tools-version: 5.9

import PackageDescription

Expand Down Expand Up @@ -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])
6 changes: 1 addition & 5 deletions Sources/ScreamURITemplate/Internal/Components.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions Sources/ScreamURITemplate/URITemplate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
12 changes: 5 additions & 7 deletions Tests/ScreamURITemplateTests/Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 8430a6a

Please sign in to comment.