Skip to content

Commit 49e6ec8

Browse files
authored
Drop Swift 5.9 (#14)
1 parent 3fd4701 commit 49e6ec8

File tree

8 files changed

+25
-19
lines changed

8 files changed

+25
-19
lines changed

.github/workflows/test.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,21 @@ jobs:
2323
fail-fast: false
2424
matrix:
2525
swift-version:
26-
- 5.9
2726
- 5.10
2827
- 6.0
28+
- 6.1
2929
include:
30-
- { swift-version: 5.9, swift-branch: swift-5.9.2-release, swift-tag: 5.9.2-RELEASE }
3130
- { swift-version: 5.10, swift-branch: swift-5.10.1-release, swift-tag: 5.10.1-RELEASE }
3231
- { swift-version: 6.0, swift-branch: swift-6.0.3-release, swift-tag: 6.0.3-RELEASE }
32+
- { swift-version: 6.1, swift-branch: swift-6.1-release, swift-tag: 6.1-RELEASE }
3333
runs-on: windows-latest
3434
timeout-minutes: 60
3535
steps:
36+
- name: Configure dev environment
37+
uses: compnerd/gha-setup-vsdevenv@main
38+
with:
39+
toolset_version: 14.29
40+
winsdk: 10.0.22621.0
3641
- name: Install Windows Swift toolchain
3742
uses: compnerd/gha-setup-swift@main
3843
with:
@@ -55,4 +60,4 @@ jobs:
5560
uses: actions/checkout@v4
5661
- name: Run unit tests
5762
run: |
58-
swift test -Xcc -I'C:/Program Files (x86)/zlib/include' -Xlinker -L'C:/Program Files (x86)/zlib/lib'
63+
swift test -Xcc -I'C:/Program Files (x86)/zlib/include' -Xcc -D_INTSAFE_H_INCLUDED_ -Xlinker -L'C:/Program Files (x86)/zlib/lib' -Xbuild-tools-swiftc -windows-sdk-root -Xbuild-tools-swiftc "${env:WindowsSdkDir}" -Xbuild-tools-swiftc -windows-sdk-version -Xbuild-tools-swiftc ${env:UCRTVersion} -Xswiftc -windows-sdk-root -Xswiftc "${env:WindowsSdkDir}" -Xswiftc -windows-sdk-version -Xswiftc ${env:UCRTVersion}

Package.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.9
1+
// swift-tools-version:5.10
22
import PackageDescription
33

44
#if canImport(Darwin) || compiler(<6.0)
@@ -51,6 +51,7 @@ var swiftSettings: [SwiftSetting] {
5151
.enableUpcomingFeature("DisableOutwardActorInference"),
5252
.enableUpcomingFeature("StrictConcurrency"),
5353
.enableExperimentalFeature("StrictConcurrency=complete"),
54+
.enableExperimentalFeature("AccessLevelOnImport"),
5455
]
5556
}
5657

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<img src="https://img.shields.io/codecov/c/github/vapor-community/Zip?style=plastic&logo=codecov&label=codecov">
1313
</a>
1414
<a href="https://swift.org">
15-
<img src="https://design.vapor.codes/images/swift59up.svg" alt="Swift 5.9+">
15+
<img src="https://design.vapor.codes/images/swift59up.svg" alt="Swift 5.10+">
1616
</a>
1717
</div>
1818
<br>
@@ -40,7 +40,7 @@ and add it to your target's dependencies:
4040

4141
### Supported Platforms
4242

43-
Zip supports all platforms supported by Swift 5.9 and later.
43+
Zip supports all platforms supported by Swift 5.10 and later.
4444

4545
To use Zip on Windows, you need to pass an available build of `zlib` to the build via extended flags. For example:
4646

Sources/Zip/ArchiveFile.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@_implementationOnly import CMinizip
1+
private import CMinizip
22
import Foundation
33

44
/// Defines data saved in memory that will be archived as a file.

Sources/Zip/Zip.docc/Documentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ and add it to your target's dependencies:
3131

3232
### Supported Platforms
3333

34-
Zip supports all platforms supported by Swift 5.9 and later.
34+
Zip supports all platforms supported by Swift 5.10 and later.
3535

3636
To use Zip on Windows, you need to pass an available build of `zlib` to the build via extended flags. For example:
3737

Sources/Zip/Zip.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,13 @@
66
// Copyright © 2015 Roy Marmelstein. All rights reserved.
77
//
88

9-
@_implementationOnly import CMinizip
9+
private import CMinizip
1010
import Foundation
1111

1212
/// Main class that handles zipping and unzipping of files.
1313
public class Zip {
1414
// Set of vaild file extensions
15-
#if compiler(>=5.10)
16-
nonisolated(unsafe) private static var customFileExtensions: Set<String> = []
17-
#else
18-
private static var customFileExtensions: Set<String> = []
19-
#endif
15+
nonisolated(unsafe) private static var customFileExtensions: Set<String> = []
2016
private static let lock = NSLock()
2117

2218
@available(*, deprecated, message: "Do not use this initializer. Zip is a utility class and should not be instantiated.")

Sources/Zip/ZipCompression.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@_implementationOnly import CMinizip
1+
private import CMinizip
22

33
/// Zip compression strategies.
44
public enum ZipCompression: Int {

Sources/Zip/ZipError.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import Foundation
1+
#if canImport(Darwin) || compiler(<6.0)
2+
import Foundation
3+
#else
4+
import FoundationEssentials
5+
#endif
26

37
/// Errors that can be thrown by Zip.
48
public enum ZipError: Error {
@@ -12,9 +16,9 @@ public enum ZipError: Error {
1216
/// A textual representation of this error.
1317
public var description: String {
1418
switch self {
15-
case .fileNotFound: return NSLocalizedString("File not found.", comment: "")
16-
case .unzipFail: return NSLocalizedString("Failed to unzip file.", comment: "")
17-
case .zipFail: return NSLocalizedString("Failed to zip file.", comment: "")
19+
case .fileNotFound: "File not found."
20+
case .unzipFail: "Failed to unzip file."
21+
case .zipFail: "Failed to zip file."
1822
}
1923
}
2024
}

0 commit comments

Comments
 (0)