diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index edd2f1c..5334233 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: test-on-macos: strategy: matrix: - xcode-version: ['16.3'] + xcode-version: ['16.4', '16.2'] runs-on: macos-15 timeout-minutes: 3 env: @@ -23,7 +23,7 @@ jobs: test-on-linux: strategy: matrix: - swift-version: ['6.1', '6.0', '5.10'] + swift-version: ['6.1', '6.0'] runs-on: ubuntu-latest timeout-minutes: 3 steps: diff --git a/Package.swift b/Package.swift index 7ca2991..8403c0a 100644 --- a/Package.swift +++ b/Package.swift @@ -1,11 +1,11 @@ -// swift-tools-version: 5.8 +// swift-tools-version: 6.0 import PackageDescription let package = Package( name: "Hex.swift", platforms: [ - .iOS(.v12), .tvOS(.v12), .watchOS(.v4), .macOS(.v10_13), + .iOS(.v14), .tvOS(.v14), .watchOS(.v7), .macOS(.v11), .macCatalyst(.v14), ], products: [ .library(name: "Hex", targets: ["Hex"]) diff --git a/Sources/Hex/Collection+Hex.swift b/Sources/Hex/Collection+Hex.swift index ae05c4a..030a2e6 100644 --- a/Sources/Hex/Collection+Hex.swift +++ b/Sources/Hex/Collection+Hex.swift @@ -21,7 +21,6 @@ extension Collection { /// /// - Parameter options: Encoding options. Default value is `[]`. @inlinable - @available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *) public func hexEncodedString(options: Base16.EncodingOptions = []) -> String { let capacity = Base16.estimateEncodedCount(bytes: count) return String(unsafeUninitializedCapacity: capacity) { buffer in diff --git a/Sources/Hex/Sequence+Hex.swift b/Sources/Hex/Sequence+Hex.swift index 498ec80..ecb3eed 100644 --- a/Sources/Hex/Sequence+Hex.swift +++ b/Sources/Hex/Sequence+Hex.swift @@ -17,11 +17,9 @@ extension Sequence { public func hexEncodedString(options: Base16.EncodingOptions = []) -> String { let seq = Base16EncodingSequence(sequence: self, options: options) - #if compiler(>=6.0) if #available(iOS 18.0, macOS 15.0, tvOS 18.0, visionOS 2.0, watchOS 11.0, *) { return String(validating: seq, as: UTF8.self).unsafelyUnwrapped } - #endif return String(bytes: seq, encoding: .utf8).unsafelyUnwrapped } diff --git a/Tests/HexTests/Base16Tests.swift b/Tests/HexTests/Base16Tests.swift index 4ae0cfe..42c1aad 100644 --- a/Tests/HexTests/Base16Tests.swift +++ b/Tests/HexTests/Base16Tests.swift @@ -1,5 +1,3 @@ -#if compiler(>=6.0) - import Foundation import Hex import Testing @@ -64,5 +62,3 @@ struct Base16Tests { #expect(result == .error) } } - -#endif diff --git a/Tests/HexTests/Collection+HexTests.swift b/Tests/HexTests/Collection+HexTests.swift index 26faeb9..a229caf 100644 --- a/Tests/HexTests/Collection+HexTests.swift +++ b/Tests/HexTests/Collection+HexTests.swift @@ -1,5 +1,3 @@ -#if compiler(>=6.0) - import Foundation import Hex import Testing @@ -60,5 +58,3 @@ struct CollectionHexTests { #expect(hexString == "") } } - -#endif diff --git a/Tests/HexTests/Data+HexTests.swift b/Tests/HexTests/Data+HexTests.swift index fc98a24..82a3e78 100644 --- a/Tests/HexTests/Data+HexTests.swift +++ b/Tests/HexTests/Data+HexTests.swift @@ -1,5 +1,3 @@ -#if compiler(>=6.0) - import Foundation import Hex import Testing @@ -126,5 +124,3 @@ struct DataHexTests { #expect(data == nil) } } - -#endif diff --git a/Tests/HexTests/JSONTests.swift b/Tests/HexTests/JSONTests.swift index a7b6e5d..49d4b36 100644 --- a/Tests/HexTests/JSONTests.swift +++ b/Tests/HexTests/JSONTests.swift @@ -1,5 +1,3 @@ -#if compiler(>=6.0) - import Foundation import Hex import Testing @@ -123,5 +121,3 @@ struct JSONTests { #expect(String(decoding: string, as: UTF8.self) == #"["313233344a4b4c4d"]"#) } } - -#endif diff --git a/Tests/HexTests/Sequence+HexTests.swift b/Tests/HexTests/Sequence+HexTests.swift index 06e02bc..adee65d 100644 --- a/Tests/HexTests/Sequence+HexTests.swift +++ b/Tests/HexTests/Sequence+HexTests.swift @@ -1,5 +1,3 @@ -#if compiler(>=6.0) - import Foundation import Hex import Testing @@ -60,5 +58,3 @@ struct SequenceHexTests { #expect(hexString == "") } } - -#endif diff --git a/benchmark.sh b/benchmark.sh index faab27b..0ca7eb3 100755 --- a/benchmark.sh +++ b/benchmark.sh @@ -15,13 +15,13 @@ mkdir -p ./benchmark/Sources/benchmark cd benchmark cat << EOF > ./Package.swift -// swift-tools-version: 5.8 +// swift-tools-version: 6.0 import PackageDescription let package = Package( name: "benchmark", - platforms: [.macOS(.v11)], + platforms: [.macOS(.v15)], dependencies: [ $PACKAGE ],