mirror of
https://github.com/XcodesOrg/XcodesApp.git
synced 2026-03-25 08:55:46 +00:00
Merge pull request #58 from RobotsAndPencils/build-identifiers-in-ui
Always show build identifiers in list and info pane
This commit is contained in:
commit
808dd022ed
5 changed files with 13 additions and 12 deletions
|
|
@ -411,7 +411,7 @@ public enum InstallationError: LocalizedError, Equatable {
|
|||
case .missingSudoerPassword:
|
||||
return "Missing password. Please try again."
|
||||
case let .unavailableVersion(version):
|
||||
return "Could not find version \(version.xcodeDescription)."
|
||||
return "Could not find version \(version.appleDescription)."
|
||||
case .noNonPrereleaseVersionAvailable:
|
||||
return "No non-prerelease versions available."
|
||||
case .noPrereleaseVersionAvailable:
|
||||
|
|
@ -419,11 +419,11 @@ public enum InstallationError: LocalizedError, Equatable {
|
|||
case .missingUsernameOrPassword:
|
||||
return "Missing username or a password. Please try again."
|
||||
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):
|
||||
return "\(version) is not a valid version number."
|
||||
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 })
|
||||
}
|
||||
|
||||
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)"
|
||||
if patch != 0 {
|
||||
base += ".\(patch)"
|
||||
|
|
@ -47,10 +52,6 @@ public extension Version {
|
|||
base += " " + prereleaseIdentifiers
|
||||
.map { $0.replacingOccurrences(of: "-", with: " ").capitalized.replacingOccurrences(of: "Gm", with: "GM") }
|
||||
.joined(separator: " ")
|
||||
|
||||
if !buildMetadataIdentifiers.isEmpty {
|
||||
base += " (\(buildMetadataIdentifiers.joined(separator: " ")))"
|
||||
}
|
||||
}
|
||||
return base
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,6 @@ struct Xcode: Identifiable, CustomStringConvertible {
|
|||
var id: Version { version }
|
||||
|
||||
var description: String {
|
||||
version.xcodeDescription
|
||||
version.appleDescription
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ struct InfoPane: View {
|
|||
icon(for: xcode)
|
||||
|
||||
VStack(alignment: .leading) {
|
||||
Text("Xcode \(xcode.description)")
|
||||
Text(verbatim: "Xcode \(xcode.description) (\(xcode.version.buildMetadataIdentifiers.joined(separator: " ")))")
|
||||
.font(.title)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ struct XcodeListViewRow: View {
|
|||
HStack {
|
||||
appIconView(for: xcode)
|
||||
|
||||
VStack(alignment: .leading) {
|
||||
Text(xcode.description)
|
||||
VStack(alignment: .leading) {
|
||||
Text(verbatim: "\(xcode.description) (\(xcode.version.buildMetadataIdentifiers.joined(separator: " ")))")
|
||||
.font(.body)
|
||||
|
||||
if case let .installed(path) = xcode.installState {
|
||||
|
|
|
|||
Loading…
Reference in a new issue