Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop 5.8 support and update SwiftLint violations #125

Merged
merged 5 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
xcode_version: ["15.3"]
swift: ["5.8.1", "5.9.2", "5.10.0"]
swift: ["5.9.2", "5.10.0"]
env:
DEVELOPER_DIR: "/Applications/Xcode_${{ matrix.xcode_version }}.app/Contents/Developer"
runs-on: macos-14
Expand Down
77 changes: 0 additions & 77 deletions Package@swift-5.8.swift

This file was deleted.

7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/giginet/Scipio/tests.yml?style=flat-square&logo=github)
![Swift 5.10](https://img.shields.io/badge/Swift-5.10-FA7343?logo=swift&style=flat-square)
![Swift 5.9](https://img.shields.io/badge/Swift-5.9-FA7343?logo=swift&style=flat-square)
![Swift 5.8](https://img.shields.io/badge/Swift-5.8-FA7343?logo=swift&style=flat-square)
[![Xcode 15.3](https://img.shields.io/badge/Xcode-15.3-147EFB?style=flat-square&logo=xcode&link=https%3A%2F%2Fdeveloper.apple.com%2Fxcode%2F)](https://developer.apple.com/xcode/)
[![Xcode 15.2](https://img.shields.io/badge/Xcode-15.2-147EFB?style=flat-square&logo=xcode&link=https%3A%2F%2Fdeveloper.apple.com%2Fxcode%2F)](https://developer.apple.com/xcode/)
[![Xcode 14.3](https://img.shields.io/badge/Xcode-14.3-147EFB?style=flat-square&logo=xcode&link=https%3A%2F%2Fdeveloper.apple.com%2Fxcode%2F)](https://developer.apple.com/xcode/)
[![SwiftPM](https://img.shields.io/badge/SwiftPM-compatible-green?logo=swift&style=flat-square)](https://swift.org/package-manager/)
[![Documentation](https://img.shields.io/badge/Documentation-available-green?style=flat-square)](https://giginet.github.io/Scipio/documentation/scipio/)
![Platforms](https://img.shields.io/badge/Platform-iOS%7CmacOS%7CwatchOS%7CtvOS%7CvisionOS-lightgray?logo=apple&style=flat-square)
Expand Down Expand Up @@ -136,15 +134,12 @@ See [Convert Single Swift Package to XCFramework](https://giginet.github.io/Scip

## Supported Xcode and Swift version

Currently, we support Swift 5.8, 5.9, and 5.10.

Swift 5.8 support will be dropped in the future.
Currently, we support Swift 5.9, and 5.10.

| | Xcode | Swift |
|----|------------|-------|
| ✅ | 15.3 | 5.10 |
| ✅ | 15.0<=15.2 | 5.9 |
| ✅ | 14.3 | 5.8 |

## Reliability

Expand Down
4 changes: 2 additions & 2 deletions Sources/ScipioKit/Executor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ extension ExecutorResult {
func unwrapOutput() throws -> String {
switch output {
case .success(let data):
return String(data: Data(data), encoding: .utf8)!
return String(decoding: Data(data), as: UTF8.self)
case .failure(let error):
throw error
}
Expand All @@ -154,7 +154,7 @@ extension ExecutorResult {
func unwrapStdErrOutput() throws -> String {
switch stderrOutput {
case .success(let data):
return String(data: Data(data), encoding: .utf8)!
return String(decoding: Data(data), as: UTF8.self)
case .failure(let error):
throw error
}
Expand Down
2 changes: 0 additions & 2 deletions Sources/ScipioKit/Producer/PIF/BuildParametersGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ struct BuildParametersGenerator {
let targetArchitecture = buildParameters.targetTriple.arch?.rawValue ?? "arm64"
#elseif swift(>=5.9)
let targetArchitecture = buildParameters.triple.arch?.rawValue ?? "arm64"
#else
let targetArchitecture = buildParameters.triple.arch.rawValue
#endif

// Generate the run destination parameters.
Expand Down
12 changes: 1 addition & 11 deletions Sources/ScipioKit/Producer/PIF/PIFCompiler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ struct PIFCompiler: Compiler {
isXcodeBuildSystemEnabled: true,
driverParameters: BuildParameters.Driver(enableParseableModuleInterfaces: buildOptions.enableLibraryEvolution)
)
#elseif swift(>=5.9)
#else
try .init(
dataPath: descriptionPackage.buildDirectory.spmAbsolutePath,
configuration: buildOptions.buildConfiguration.spmConfiguration,
Expand All @@ -134,16 +134,6 @@ struct PIFCompiler: Compiler {
enableParseableModuleInterfaces: buildOptions.enableLibraryEvolution,
isXcodeBuildSystemEnabled: true
)
#else
.init(
dataPath: descriptionPackage.buildDirectory,
configuration: buildOptions.buildConfiguration.spmConfiguration,
toolchain: toolchain,
destinationTriple: toolchain.triple,
flags: .init(),
enableParseableModuleInterfaces: buildOptions.enableLibraryEvolution,
isXcodeBuildSystemEnabled: true
)
#endif
}
}
Expand Down
2 changes: 0 additions & 2 deletions Sources/ScipioKit/Producer/PIF/ToolchainGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import Foundation
import TSCUtility
import PackageModel
import TSCBasic
#if swift(>=5.9)
import struct Basics.Triple
#endif

struct ToolchainGenerator {
private let toolchainDirPath: AbsolutePath
Expand Down
2 changes: 1 addition & 1 deletion Tests/ScipioKitTests/CacheSystemTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault
let encoder = JSONEncoder()
encoder.outputFormatting = [.sortedKeys, .prettyPrinted]
let data = try encoder.encode(cacheKey)
let rawString = try XCTUnwrap(String(data: data, encoding: .utf8))
let rawString = try XCTUnwrap(String(decoding: data, as: UTF8.self))
let expected = """
{
"buildOptions" : {
Expand Down
8 changes: 4 additions & 4 deletions Tests/ScipioKitTests/RunnerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ final class RunnerTests: XCTestCase {

private let plistDecoder: PropertyListDecoder = .init()

override class func setUp() {
override static func setUp() {
LoggingSystem.bootstrap { _ in SwiftLogNoOpLogHandler() }

super.setUp()
Expand Down Expand Up @@ -136,7 +136,7 @@ final class RunnerTests: XCTestCase {
fileManager.fileExists(atPath: moduleMapPath),
"Should exist a modulemap"
)
let moduleMapContents = try XCTUnwrap(fileManager.contents(atPath: moduleMapPath).flatMap { String(data: $0, encoding: .utf8) })
let moduleMapContents = try XCTUnwrap(fileManager.contents(atPath: moduleMapPath).flatMap { String(decoding: $0, as: UTF8.self) })
XCTAssertEqual(
moduleMapContents,
"""
Expand Down Expand Up @@ -186,7 +186,7 @@ final class RunnerTests: XCTestCase {
fileManager.fileExists(atPath: moduleMapPath),
"Should exist a modulemap"
)
let moduleMapContents = try XCTUnwrap(fileManager.contents(atPath: moduleMapPath).flatMap { String(data: $0, encoding: .utf8) })
let moduleMapContents = try XCTUnwrap(fileManager.contents(atPath: moduleMapPath).flatMap { String(decoding: $0, as: UTF8.self) })
XCTAssertEqual(
moduleMapContents,
"""
Expand Down Expand Up @@ -630,7 +630,7 @@ final class RunnerTests: XCTestCase {
XCTAssertTrue(fileManager.fileExists(atPath: moduleMapPath.path))

let generatedModuleMapData = try XCTUnwrap(fileManager.contents(atPath: moduleMapPath.path))
let generatedModuleMapContents = String(data: generatedModuleMapData, encoding: .utf8)
let generatedModuleMapContents = String(decoding: generatedModuleMapData, as: UTF8.self)

let expectedModuleMap = """
framework module MyTarget {
Expand Down
Loading