Skip to content

Commit c628ef3

Browse files
committed
Swift 6
1 parent b542a92 commit c628ef3

File tree

5 files changed

+70
-30
lines changed

5 files changed

+70
-30
lines changed

.github/workflows/build.yml

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ on:
66
workflow_dispatch:
77

88
jobs:
9-
xcode_15_2:
9+
xcode_16:
1010
runs-on: macos-14
11-
env:
12-
DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer
1311
steps:
1412
- name: Checkout
1513
uses: actions/checkout@v4
14+
- name: 🔍 Xcode Select
15+
run: |
16+
XCODE_PATH=`mdfind "kMDItemCFBundleIdentifier == 'com.apple.dt.Xcode' && kMDItemVersion == '16.0'" -onlyin /Applications | head -1`
17+
echo "DEVELOPER_DIR=$XCODE_PATH/Contents/Developer" >> $GITHUB_ENV
1618
- name: Version
1719
run: swift --version
1820
- name: Build
@@ -27,10 +29,24 @@ jobs:
2729
token: ${{ secrets.CODECOV_TOKEN }}
2830
files: ./coverage_report.lcov
2931

30-
xcode_14_3_1:
31-
runs-on: macos-13
32+
xcode_15_4:
33+
runs-on: macos-14
34+
env:
35+
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v4
39+
- name: Version
40+
run: swift --version
41+
- name: Build
42+
run: swift build --build-tests
43+
- name: Test
44+
run: swift test --skip-build
45+
46+
xcode_15_2:
47+
runs-on: macos-14
3248
env:
33-
DEVELOPER_DIR: /Applications/Xcode_14.3.1.app/Contents/Developer
49+
DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer
3450
steps:
3551
- name: Checkout
3652
uses: actions/checkout@v4
@@ -54,9 +70,9 @@ jobs:
5470
- name: Test
5571
run: swift test --skip-build
5672

57-
linux_swift_5_9_2:
73+
linux_swift_5_9:
5874
runs-on: ubuntu-latest
59-
container: swift:5.9.2
75+
container: swift:5.9
6076
steps:
6177
- name: Checkout
6278
uses: actions/checkout@v4
@@ -67,9 +83,9 @@ jobs:
6783
- name: Test
6884
run: swift test --skip-build
6985

70-
linux_swift_5_8:
86+
linux_swift_6_0:
7187
runs-on: ubuntu-latest
72-
container: swift:5.8
88+
container: swiftlang/swift:nightly-6.0-jammy
7389
steps:
7490
- name: Checkout
7591
uses: actions/checkout@v4

Package.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// swift-tools-version:5.8
1+
// swift-tools-version:6.0
22
import PackageDescription
33

44
let package = Package(
55
name: "KeyValueCoder",
66
platforms: [
7-
.macOS(.v13), .iOS(.v15)
7+
.macOS(.v13), .iOS(.v15), .tvOS(.v15), .watchOS(.v8)
88
],
99
products: [
1010
.library(
@@ -32,7 +32,7 @@ extension Array where Element == SwiftSetting {
3232
static var upcomingFeatures: [SwiftSetting] {
3333
[
3434
.enableUpcomingFeature("ExistentialAny"),
35-
.enableExperimentalFeature("StrictConcurrency")
35+
.swiftLanguageMode(.v6)
3636
]
3737
}
3838
}

Package@swift-5.9.swift

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// swift-tools-version:5.9
2+
import PackageDescription
3+
4+
let package = Package(
5+
name: "KeyValueCoder",
6+
platforms: [
7+
.macOS(.v13), .iOS(.v15), .tvOS(.v15), .watchOS(.v8)
8+
],
9+
products: [
10+
.library(
11+
name: "KeyValueCoder",
12+
targets: ["KeyValueCoder"]
13+
),
14+
],
15+
targets: [
16+
.target(
17+
name: "KeyValueCoder",
18+
path: "Sources",
19+
swiftSettings: .upcomingFeatures
20+
),
21+
.testTarget(
22+
name: "KeyValueCoderTests",
23+
dependencies: ["KeyValueCoder"],
24+
path: "Tests",
25+
swiftSettings: .upcomingFeatures
26+
)
27+
]
28+
)
29+
30+
extension Array where Element == SwiftSetting {
31+
32+
static var upcomingFeatures: [SwiftSetting] {
33+
[
34+
.enableUpcomingFeature("ExistentialAny"),
35+
.enableExperimentalFeature("StrictConcurrency")
36+
]
37+
}
38+
}

Sources/KeyValueDecoder.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -213,20 +213,6 @@ private extension KeyValueDecoder {
213213
}
214214
}
215215

216-
// func getDoubleValue(from value: Any, using strategy: IntDecodingStrategy) -> Double? {
217-
// guard let double = (value as? NSNumber)?.getDoubleValue() else {
218-
// return nil
219-
// }
220-
// switch strategy {
221-
// case .exact:
222-
// return double
223-
// case .rounded(rule: let rule):
224-
// return double.rounded(rule)
225-
// case .clamping(rule: let rule):
226-
// return double.rounded(rule)
227-
// }
228-
// }
229-
230216
func decode(_ type: Bool.Type) throws -> Bool {
231217
try getValue()
232218
}

Tests/KeyValueEncoderTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ final class KeyValueEncodedTests: XCTestCase {
5454
}
5555

5656
func testSingleContainer_Encodes_Duration() throws {
57-
guard #available(iOS 16.0, macOS 13.0, *) else { return }
57+
guard #available(iOS 16.0, tvOS 16.0, watchOS 9.0, *) else { return }
5858
XCTAssertEqual(
5959
try KeyValueEncoder.encodeSingleValue {
6060
try $0.encode(Duration.nanoseconds(1))
@@ -716,7 +716,7 @@ private struct StubEncoder: Encodable {
716716
}
717717
}
718718

719-
extension AnyCodingKey: ExpressibleByStringLiteral {
719+
extension AnyCodingKey: Swift.ExpressibleByStringLiteral {
720720
public init(stringLiteral value: String) {
721721
self.init(stringValue: value)
722722
}
@@ -737,7 +737,7 @@ struct Node: Codable, Equatable {
737737
}
738738
}
739739

740-
extension KeyValueEncoder.EncodedValue: Equatable {
740+
extension KeyValueEncoder.EncodedValue: Swift.Equatable {
741741

742742
public static func ==(lhs: Self, rhs: Self) -> Bool {
743743
do {

0 commit comments

Comments
 (0)