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: 5 additions & 1 deletion .swiftpm/xcode/xcshareddata/xcschemes/xcodes.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,13 @@
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "runtimes install &quot;visionOS 1.0-beta1&quot;"
argument = "runtimes install &quot;visionOS 26.0-beta3 arm64&quot;"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = "runtimes --include-betas"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "install --help"
isEnabled = "NO">
Expand Down
6 changes: 4 additions & 2 deletions Sources/XcodesKit/Models+Runtimes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public struct DownloadableRuntime: Decodable {
let category: Category
let simulatorVersion: SimulatorVersion
let source: String?
let architectures: [String]?
let dictionaryVersion: Int
let contentType: ContentType
let platform: Platform
Expand All @@ -23,7 +24,7 @@ public struct DownloadableRuntime: Decodable {
let authentication: Authentication?

var betaNumber: Int? {
enum Regex { static let shared = try! NSRegularExpression(pattern: "b[0-9]+$") }
enum Regex { static let shared = try! NSRegularExpression(pattern: "b[0-9]+") }
guard var foundString = Regex.shared.firstString(in: identifier) else { return nil }
foundString.removeFirst()
return Int(foundString)!
Expand All @@ -34,7 +35,7 @@ public struct DownloadableRuntime: Decodable {
}

var visibleIdentifier: String {
return platform.shortName + " " + completeVersion
return platform.shortName + " " + completeVersion + (architectures != nil ? " \(architectures?.joined(separator: "|") ?? "")" : "")
}
}

Expand All @@ -53,6 +54,7 @@ struct SDKToSimulatorMapping: Decodable {
let sdkBuildUpdate: String
let simulatorBuildUpdate: String
let sdkIdentifier: String
let downloadableIdentifiers: [String]?
}

extension DownloadableRuntime {
Expand Down
14 changes: 9 additions & 5 deletions Sources/XcodesKit/RuntimeInstaller.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ public class RuntimeInstaller {
betaNumber: downloadable.betaNumber,
version: downloadable.simulatorVersion.version,
build: downloadable.simulatorVersion.buildUpdate,
kind: $0.kind))
kind: $0.kind,
architectures: downloadable.architectures))
}
} else {
mappedRuntimes.append(PrintableRuntime(platform: downloadable.platform,
betaNumber: downloadable.betaNumber,
version: downloadable.simulatorVersion.version,
build: downloadable.simulatorVersion.buildUpdate))
build: downloadable.simulatorVersion.buildUpdate,
architectures: downloadable.architectures))
}
}

Expand All @@ -47,7 +49,8 @@ public class RuntimeInstaller {
betaNumber: resolvedBetaNumber,
version: runtime.version,
build: runtime.build,
kind: runtime.kind)
kind: runtime.kind,
architectures: nil)

mappedRuntimes.indices {
result.visibleIdentifier == $0.visibleIdentifier
Expand Down Expand Up @@ -361,7 +364,7 @@ extension RuntimeInstaller {
public var errorDescription: String? {
switch self {
case let .unavailableRuntime(version):
return "Runtime \(version) is invalid or not downloadable"
return "Runtime \(version) is invalid or not downloadable. Please include arm64 or x86_64 in the version string if shown."
case .failedMountingDMG:
return "Failed to mount image."
case .rootNeeded:
Expand All @@ -384,13 +387,14 @@ fileprivate struct PrintableRuntime {
let build: String
var kind: InstalledRuntime.Kind? = nil
var hasDuplicateVersion = false
let architectures: [String]?

var completeVersion: String {
makeVersion(for: version, betaNumber: betaNumber)
}

var visibleIdentifier: String {
return platform.shortName + " " + completeVersion
return platform.shortName + " " + completeVersion + (architectures != nil ? " \(architectures?.joined(separator: "|") ?? "")" : "")
}
}

Expand Down