Skip to content
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
6 changes: 3 additions & 3 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ let package = Package(
.package(url: "https://github.com/SwiftPackageIndex/Plot.git", branch: "main"),
.package(url: "https://github.com/SwiftPackageIndex/CanonicalPackageURL.git", from: "1.0.0"),
.package(url: "https://github.com/SwiftPackageIndex/DependencyResolution.git", from: "1.1.2"),
.package(url: "https://github.com/SwiftPackageIndex/SPIManifest.git", from: "1.2.0"),
.package(url: "https://github.com/SwiftPackageIndex/SPIManifest.git", from: "1.9.0"),
.package(url: "https://github.com/SwiftPackageIndex/SemanticVersion.git", from: "0.3.0"),
.package(url: "https://github.com/SwiftPackageIndex/ShellOut.git", from: "3.1.4"),
.package(url: "https://github.com/swiftlang/swift-package-manager.git", branch: "release/6.1"),
Expand Down
6 changes: 6 additions & 0 deletions Sources/App/Commands/TriggerBuilds.swift
Original file line number Diff line number Diff line change
Expand Up @@ -383,11 +383,17 @@ struct BuildPair {
static let all = Build.Platform.allActive.flatMap { platform in
SwiftVersion.allActive.compactMap { swiftVersion in
switch platform {
case .android:
// Android is supported from Swift version 6.1+
return swiftVersion >= .v6_1 ? BuildPair(platform, swiftVersion) : nil
case .iOS, .linux, .macosSpm, .macosXcodebuild, .tvOS, .watchOS:
return BuildPair(platform, swiftVersion)
case .visionOS:
// visionOS is only available for Swift versions 5.9+
return swiftVersion >= .v5_9 ? BuildPair(platform, swiftVersion) : nil
case .wasm:
// Android is supported from Swift version 6.1+
return swiftVersion >= .v6_1 ? BuildPair(platform, swiftVersion) : nil
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions Sources/App/Controllers/CompatibilityMatrix.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ extension CompatibilityMatrix {
case watchOS
case tvOS
case linux
case wasm
case android

static func <(lhs: Self, rhs: Self) -> Bool { allCases.firstIndex(of: lhs)! < allCases.firstIndex(of: rhs)! }
}
Expand Down
4 changes: 4 additions & 0 deletions Sources/App/Controllers/PackageController+ShowRoute.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,16 @@ extension Array where Element == PackageController.BuildsRoute.BuildInfo {
extension Build.Platform {
func isCompatible(with other: CompatibilityMatrix.Platform) -> Bool {
switch self {
case .android:
return other == .android
case .iOS:
return other == .iOS
case .macosSpm, .macosXcodebuild:
return other == .macOS
case .tvOS:
return other == .tvOS
case .wasm:
return other == .wasm
case .watchOS:
return other == .watchOS
case .visionOS:
Expand Down
4 changes: 4 additions & 0 deletions Sources/App/Core/Extensions/Badge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ extension Badge {
return .init(left: 4, right: "watchOS")
case .linux:
return .init(left: 5, right: "Linux")
case .wasm:
return .init(left: 6, right: "Wasm")
case .android:
return .init(left: 7, right: "Android")
}
}
)
Expand Down
4 changes: 4 additions & 0 deletions Sources/App/Core/Extensions/BuildPair+ext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ extension BuildPair {
return .visionOS
case .watchOS:
return .watchOS
case .wasm:
return .wasm
case .android:
return .android
}
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/App/Core/PackageCollection+generate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ extension Array where Element == PackageCollection.Compatibility {
private extension PackageCollection.Platform {
init(platform: Build.Platform) {
switch platform {
case .iOS, .tvOS, .visionOS, .watchOS, .linux:
case .android, .iOS, .tvOS, .visionOS, .watchOS, .linux, .wasm:
self.init(name: platform.rawValue)
case .macosSpm, .macosXcodebuild:
self.init(name: "macos")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ struct PlatformSearchFilter: SearchFilterProtocol {
private extension Package.PlatformCompatibility {
var displayDescription: String {
switch self {
case .android:
return "Android"
case .iOS:
return "iOS"
case .macOS:
Expand All @@ -67,6 +69,8 @@ private extension Package.PlatformCompatibility {
return "tvOS"
case .visionOS:
return "visionOS"
case .wasm:
return "Wasm"
case .watchOS:
return "watchOS"
}
Expand Down
24 changes: 19 additions & 5 deletions Sources/App/Models/Build+Platform.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,57 +17,67 @@ import SPIManifest

extension Build {
enum Platform: String, Codable, Equatable, CaseIterable {
case android
case iOS = "ios"
case linux
case macosSpm = "macos-spm"
case macosXcodebuild = "macos-xcodebuild"
case tvOS = "tvos"
case visionOS = "visionos"
case wasm
case watchOS = "watchos"

var name: String {
switch self {
case .android:
return "Android"
case .iOS:
return "iOS"
case .linux:
return "Linux"
case .macosSpm:
return "macOS - SPM"
case .macosXcodebuild:
return "macOS - xcodebuild"
case .tvOS:
return "tvOS"
case .wasm:
return "Wasm"
case .watchOS:
return "watchOS"
case .visionOS:
return "visionOS"
case .linux:
return "Linux"
}
}

var displayName: String {
switch self {
case .android:
return "Android"
case .iOS:
return "iOS"
case .linux:
return "Linux"
case .macosSpm:
return "macOS (SPM)"
case .macosXcodebuild:
return "macOS (Xcode)"
case .tvOS:
return "tvOS"
case .wasm:
return "Wasm"
case .watchOS:
return "watchOS"
case .visionOS:
return "visionOS"
case .linux:
return "Linux"
}
}

/// Currently supported build platforms
static var allActive: [Self] {
// The order of this array defines the platform order on the BuildIndex page. Keep this aliged with the
// order in GetRoute.Model.PlatformResults (which is the order in the build matrix on the PackageShow page).
let active: [Self] = [.iOS, .macosSpm, .macosXcodebuild, .visionOS, .tvOS, .watchOS, .linux]
let active: [Self] = [.iOS, .macosSpm, .macosXcodebuild, .visionOS, .tvOS, .watchOS, .linux, .wasm, .android]
assert(active.count == allCases.count, "mismatch in Build.Platform and active platform count")
return active
}
Expand All @@ -78,6 +88,8 @@ extension Build {
/// - Parameter spiManifestPlatform: SPIManifest platform
private init(_ spiManifestPlatform: SPIManifest.Platform) {
switch spiManifestPlatform {
case .android:
self = .android
case .iOS:
self = .iOS
case .linux:
Expand All @@ -90,6 +102,8 @@ extension Build {
self = .tvOS
case .visionOS:
self = .visionOS
case .wasm:
self = .wasm
case .watchOS:
self = .watchOS
}
Expand Down
2 changes: 2 additions & 0 deletions Sources/App/Models/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,13 @@ extension Package: Hashable {

extension Package {
enum PlatformCompatibility: String, Codable {
case android
case iOS = "ios"
case macOS = "macos"
case linux
case tvOS = "tvos"
case visionOS = "visionos"
case wasm
case watchOS = "watchos"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ extension BuildShow {
(.visionOS, let swift),
(.watchOS, let swift):
return swift.xcodeVersion
case (.macosSpm, _), (.linux, _):
case (.android, _), (.macosSpm, _), (.linux, _), (.wasm, _):
return nil
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
extension CompatibilityMatrix.Platform: BuildResultPresentable {
var displayName: String {
switch self {
case .android:
return "Android"
case .iOS:
return "iOS"
case .linux:
Expand All @@ -26,15 +28,19 @@ extension CompatibilityMatrix.Platform: BuildResultPresentable {
return "tvOS"
case .visionOS:
return "visionOS"
case .wasm:
return "Wasm"
case .watchOS:
return "watchOS"
}
}

var longDisplayName: String {
switch self {
case .macOS, .iOS, .linux, .tvOS, .visionOS, .watchOS:
case .android, .macOS, .iOS, .linux, .tvOS, .visionOS, .watchOS:
return displayName
case .wasm:
return "WebAssembly"
}
}

Expand Down
4 changes: 2 additions & 2 deletions Tests/AppTests/BuildIndexModelTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ extension AllTests.BuildIndexModelTests {
let matrix = model.buildMatrix

// validate
#expect(matrix.values.keys.count == 28)
#expect(matrix.values.keys.count == 30)
#expect(
matrix.values[.init(swiftVersion: .v3, platform: .iOS)]?.map(\.column.label) == ["1.2.3", "2.0.0-b1", "main"]
)
Expand Down Expand Up @@ -141,7 +141,7 @@ extension AllTests.BuildIndexModelTests {
let matrix = model.buildMatrix

// validate
#expect(matrix.values.keys.count == 28)
#expect(matrix.values.keys.count == 30)
#expect(
matrix.values[.init(swiftVersion: .v3, platform: .iOS)]?.map(\.column.label) == ["1.2.3", "main"]
)
Expand Down
Loading
Loading