mirror of
https://github.com/XcodesOrg/XcodesApp.git
synced 2026-04-27 15:07:39 +00:00
Always show build identifiers in list and info pane
This commit is contained in:
parent
12bf1ad8be
commit
a504504825
5 changed files with 13 additions and 12 deletions
|
|
@ -411,7 +411,7 @@ public enum InstallationError: LocalizedError, Equatable {
|
||||||
case .missingSudoerPassword:
|
case .missingSudoerPassword:
|
||||||
return "Missing password. Please try again."
|
return "Missing password. Please try again."
|
||||||
case let .unavailableVersion(version):
|
case let .unavailableVersion(version):
|
||||||
return "Could not find version \(version.xcodeDescription)."
|
return "Could not find version \(version.appleDescription)."
|
||||||
case .noNonPrereleaseVersionAvailable:
|
case .noNonPrereleaseVersionAvailable:
|
||||||
return "No non-prerelease versions available."
|
return "No non-prerelease versions available."
|
||||||
case .noPrereleaseVersionAvailable:
|
case .noPrereleaseVersionAvailable:
|
||||||
|
|
@ -419,11 +419,11 @@ public enum InstallationError: LocalizedError, Equatable {
|
||||||
case .missingUsernameOrPassword:
|
case .missingUsernameOrPassword:
|
||||||
return "Missing username or a password. Please try again."
|
return "Missing username or a password. Please try again."
|
||||||
case let .versionAlreadyInstalled(installedXcode):
|
case let .versionAlreadyInstalled(installedXcode):
|
||||||
return "\(installedXcode.version.xcodeDescription) is already installed at \(installedXcode.path)"
|
return "\(installedXcode.version.appleDescription) is already installed at \(installedXcode.path)"
|
||||||
case let .invalidVersion(version):
|
case let .invalidVersion(version):
|
||||||
return "\(version) is not a valid version number."
|
return "\(version) is not a valid version number."
|
||||||
case let .versionNotInstalled(version):
|
case let .versionNotInstalled(version):
|
||||||
return "\(version.xcodeDescription) is not installed."
|
return "\(version.appleDescription) is not installed."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,12 @@ public extension Version {
|
||||||
self = Version(major: major, minor: minor, patch: patch, prereleaseIdentifiers: prereleaseIdentifiers, buildMetadataIdentifiers: [buildMetadataIdentifier].compactMap { $0 })
|
self = Version(major: major, minor: minor, patch: patch, prereleaseIdentifiers: prereleaseIdentifiers, buildMetadataIdentifiers: [buildMetadataIdentifier].compactMap { $0 })
|
||||||
}
|
}
|
||||||
|
|
||||||
var xcodeDescription: String {
|
/// The intent here is to match Apple's marketing version
|
||||||
|
///
|
||||||
|
/// Only show the patch number if it's not 0
|
||||||
|
/// Format prerelease identifiers
|
||||||
|
/// Don't include build identifiers
|
||||||
|
var appleDescription: String {
|
||||||
var base = "\(major).\(minor)"
|
var base = "\(major).\(minor)"
|
||||||
if patch != 0 {
|
if patch != 0 {
|
||||||
base += ".\(patch)"
|
base += ".\(patch)"
|
||||||
|
|
@ -47,10 +52,6 @@ public extension Version {
|
||||||
base += " " + prereleaseIdentifiers
|
base += " " + prereleaseIdentifiers
|
||||||
.map { $0.replacingOccurrences(of: "-", with: " ").capitalized.replacingOccurrences(of: "Gm", with: "GM") }
|
.map { $0.replacingOccurrences(of: "-", with: " ").capitalized.replacingOccurrences(of: "Gm", with: "GM") }
|
||||||
.joined(separator: " ")
|
.joined(separator: " ")
|
||||||
|
|
||||||
if !buildMetadataIdentifiers.isEmpty {
|
|
||||||
base += " (\(buildMetadataIdentifiers.joined(separator: " ")))"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return base
|
return base
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,6 @@ struct Xcode: Identifiable, CustomStringConvertible {
|
||||||
var id: Version { version }
|
var id: Version { version }
|
||||||
|
|
||||||
var description: String {
|
var description: String {
|
||||||
version.xcodeDescription
|
version.appleDescription
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ struct InfoPane: View {
|
||||||
icon(for: xcode)
|
icon(for: xcode)
|
||||||
|
|
||||||
VStack(alignment: .leading) {
|
VStack(alignment: .leading) {
|
||||||
Text("Xcode \(xcode.description)")
|
Text(verbatim: "Xcode \(xcode.description) (\(xcode.version.buildMetadataIdentifiers.joined(separator: " ")))")
|
||||||
.font(.title)
|
.font(.title)
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@ struct XcodeListViewRow: View {
|
||||||
HStack {
|
HStack {
|
||||||
appIconView(for: xcode)
|
appIconView(for: xcode)
|
||||||
|
|
||||||
VStack(alignment: .leading) {
|
VStack(alignment: .leading) {
|
||||||
Text(xcode.description)
|
Text(verbatim: "\(xcode.description) (\(xcode.version.buildMetadataIdentifiers.joined(separator: " ")))")
|
||||||
.font(.body)
|
.font(.body)
|
||||||
|
|
||||||
if case let .installed(path) = xcode.installState {
|
if case let .installed(path) = xcode.installState {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue