Skip to content

Commit

Permalink
Upgraded to swift 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
samdeane committed Sep 2, 2024
1 parent 4ad3824 commit 4ee9745
Show file tree
Hide file tree
Showing 6 changed files with 542 additions and 503 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.6
// swift-tools-version:6.0

// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// Created by Sam Deane on 04/07/22.
Expand Down
148 changes: 85 additions & 63 deletions Sources/ActionBuilderCore/Compiler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,72 +5,94 @@

import Foundation

public class Compiler: Identifiable {
public enum XcodeMode {
case xcode(version: String, image: String = "macos-latest")
case toolchain(version: String, branch: String, image: String = "macos-latest")
}

public let id: ID
let name: String
let short: String
let linux: String
let mac: XcodeMode

public init(_ id: ID, name: String, short: String, linux: String, mac: XcodeMode) {
self.id = id
self.name = name
self.short = short
self.linux = linux
self.mac = mac
}

func supportsTesting(on platform: Platform.ID) -> Bool {
// no Xcode version supports watchOS testing
if platform == .watchOS {
return false
}
public final class Compiler: Identifiable, Sendable {
public enum XcodeMode: Sendable {
case xcode(version: String, image: String = "macos-latest")
case toolchain(version: String, branch: String, image: String = "macos-latest")
}

public let id: ID
let name: String
let short: String
let linux: String
let mac: XcodeMode

// macOS toolchain builds can't support testing on iOS/tvOS as they don't include the simulator
if platform != .macOS, case .toolchain = mac {
return false
}

return true
public init(_ id: ID, name: String, short: String, linux: String, mac: XcodeMode) {
self.id = id
self.name = name
self.short = short
self.linux = linux
self.mac = mac
}

func supportsTesting(on platform: Platform.ID) -> Bool {
// no Xcode version supports watchOS testing
if platform == .watchOS {
return false
}

public enum ID: String, Equatable, CaseIterable, Codable {
case swift50
case swift51
case swift52
case swift53
case swift54
case swift55
case swift56
case swift57

case swiftLatest
case swiftNightly

static let latestRelease = Self.swift57

// macOS toolchain builds can't support testing on iOS/tvOS as they don't include the simulator
if platform != .macOS, case .toolchain = mac {
return false
}

public static let compilers: [Compiler] = [
// See https://github.com/actions/virtual-environments for available Xcode versions.
// See https://swiftly.dev/swift-versions for Xcode/Swift version mapping.

Compiler(.swift50, name: "Swift 5.0", short: "5.0", linux: "swift:5.0", mac: .xcode(version: "11.2.1", image: "macos-10.15")),
Compiler(.swift51, name: "Swift 5.1", short: "5.1", linux: "swift:5.1", mac: .xcode(version: "11.3.1", image: "macos-10.15")),
Compiler(.swift52, name: "Swift 5.2", short: "5.2", linux: "swift:5.2.3-bionic", mac: .xcode(version: "11.7", image: "macos-11")),
Compiler(.swift53, name: "Swift 5.3", short: "5.3", linux: "swift:5.3.3-bionic", mac: .xcode(version: "12.4", image: "macos-11")),
Compiler(.swift54, name: "Swift 5.4", short: "5.4", linux: "swift:5.4.2-bionic", mac: .xcode(version: "12.5.1", image: "macos-11")),
Compiler(.swift55, name: "Swift 5.5", short: "5.5", linux: "swift:5.5.3-bionic", mac: .xcode(version: "13.0", image: "macos-11")),
Compiler(.swift56, name: "Swift 5.6", short: "5.6", linux: "swift:5.6.2-bionic", mac: .xcode(version: "13.4.1", image: "macos-12")),

// https://download.swift.org/development/xcode/swift-5.7-DEVELOPMENT-SNAPSHOT-2022-06-26-a/swift-5.7-DEVELOPMENT-SNAPSHOT-2022-06-26-a-osx.pkg
Compiler(.swift57, name: "Swift 5.7", short: "5.7", linux: "swiftlang/swift:nightly-5.7-bionic", mac: .toolchain(version: "13.4.1", branch: "swift-5.7-branch", image: "macos-12")),
return true
}

public enum ID: String, Equatable, CaseIterable, Codable, Sendable {
case swift50
case swift51
case swift52
case swift53
case swift54
case swift55
case swift56
case swift57
case swift58
case swift59
case swift60

case swiftLatest
case swiftNightly

static let latestRelease = Self.swift60
}

public static let compilers: [Compiler] = [
// See https://github.com/actions/virtual-environments for available Xcode versions.
// See https://swiftly.dev/swift-versions for Xcode/Swift version mapping.

Compiler(
.swift50, name: "Swift 5.0", short: "5.0", linux: "swift:5.0",
mac: .xcode(version: "11.2.1", image: "macos-10.15")),
Compiler(
.swift51, name: "Swift 5.1", short: "5.1", linux: "swift:5.1",
mac: .xcode(version: "11.3.1", image: "macos-10.15")),
Compiler(
.swift52, name: "Swift 5.2", short: "5.2", linux: "swift:5.2.3-bionic",
mac: .xcode(version: "11.7", image: "macos-11")),
Compiler(
.swift53, name: "Swift 5.3", short: "5.3", linux: "swift:5.3.3-bionic",
mac: .xcode(version: "12.4", image: "macos-11")),
Compiler(
.swift54, name: "Swift 5.4", short: "5.4", linux: "swift:5.4.2-bionic",
mac: .xcode(version: "12.5.1", image: "macos-11")),
Compiler(
.swift55, name: "Swift 5.5", short: "5.5", linux: "swift:5.5.3-bionic",
mac: .xcode(version: "13.0", image: "macos-11")),
Compiler(
.swift56, name: "Swift 5.6", short: "5.6", linux: "swift:5.6.2-bionic",
mac: .xcode(version: "13.4.1", image: "macos-12")),

// https://download.swift.org/development/xcode/swift-5.7-DEVELOPMENT-SNAPSHOT-2022-06-26-a/swift-5.7-DEVELOPMENT-SNAPSHOT-2022-06-26-a-osx.pkg
Compiler(
.swift57, name: "Swift 5.7", short: "5.7", linux: "swiftlang/swift:nightly-5.7-bionic",
mac: .toolchain(version: "13.4.1", branch: "swift-5.7-branch", image: "macos-12")),

// https://download.swift.org/development/xcode/swift-DEVELOPMENT-SNAPSHOT-2022-03-22-a/swift-DEVELOPMENT-SNAPSHOT-2022-03-22-a-osx.pkg
Compiler(.swiftNightly, name: "Swift Development Nightly", short: "dev", linux: "swiftlang/swift:nightly", mac: .toolchain(version: "13.4.1", branch: "development", image: "macos-12")),
]
// https://download.swift.org/development/xcode/swift-DEVELOPMENT-SNAPSHOT-2022-03-22-a/swift-DEVELOPMENT-SNAPSHOT-2022-03-22-a-osx.pkg
Compiler(
.swiftNightly, name: "Swift Development Nightly", short: "dev",
linux: "swiftlang/swift:nightly",
mac: .toolchain(version: "13.4.1", branch: "development", image: "macos-12")),
]
}
20 changes: 10 additions & 10 deletions Sources/ActionBuilderCore/Configuration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

import Foundation

public enum Configuration: String, Codable, CaseIterable {
case debug
case release
public enum Configuration: String, Codable, CaseIterable, Sendable {
case debug
case release

public var name: String {
return rawValue.capitalized
}
public var xcodeID: String {
return rawValue.capitalized
}
public var name: String {
return rawValue.capitalized
}

public var xcodeID: String {
return rawValue.capitalized
}
}
Loading

0 comments on commit 4ee9745

Please sign in to comment.