Skip to content

Commit 14b2b3d

Browse files
committed
support displaying multiple architectures in runtimes
1 parent f3f3bf0 commit 14b2b3d

5 files changed

Lines changed: 37 additions & 3 deletions

File tree

Xcodes.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
CAFE4AB425B7D3AF0064FE51 /* AdvancedPreferencePane.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAFE4AB325B7D3AF0064FE51 /* AdvancedPreferencePane.swift */; };
116116
CAFE4ABC25B7D54B0064FE51 /* UpdatesPreferencePane.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAFE4ABB25B7D54B0064FE51 /* UpdatesPreferencePane.swift */; };
117117
CAFFFED8259CDA5000903F81 /* XcodeListViewRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAFFFED7259CDA5000903F81 /* XcodeListViewRow.swift */; };
118+
D93F95C12E0C8C1A00238FB5 /* TagView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D93F95C02E0C8C1A00238FB5 /* TagView.swift */; };
118119
E689540325BE8C64000EBCEA /* DockProgress in Frameworks */ = {isa = PBXBuildFile; productRef = E689540225BE8C64000EBCEA /* DockProgress */; };
119120
E81D7EA02805250100A205FC /* Collection+.swift in Sources */ = {isa = PBXBuildFile; fileRef = E81D7E9F2805250100A205FC /* Collection+.swift */; };
120121
E832EAF82B0FBCF4001B570D /* RuntimeInstallationStepDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E832EAF72B0FBCF4001B570D /* RuntimeInstallationStepDetailView.swift */; };
@@ -321,6 +322,7 @@
321322
CAFE4ABB25B7D54B0064FE51 /* UpdatesPreferencePane.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UpdatesPreferencePane.swift; sourceTree = "<group>"; };
322323
CAFFFED7259CDA5000903F81 /* XcodeListViewRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XcodeListViewRow.swift; sourceTree = "<group>"; };
323324
CAFFFEEE259CEAC400903F81 /* RingProgressViewStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RingProgressViewStyle.swift; sourceTree = "<group>"; };
325+
D93F95C02E0C8C1A00238FB5 /* TagView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TagView.swift; sourceTree = "<group>"; };
324326
E81D7E9F2805250100A205FC /* Collection+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Collection+.swift"; sourceTree = "<group>"; };
325327
E832EAF72B0FBCF4001B570D /* RuntimeInstallationStepDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RuntimeInstallationStepDetailView.swift; sourceTree = "<group>"; };
326328
E84B7D0C2B296A8900DBDA2B /* NavigationSplitViewWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationSplitViewWrapper.swift; sourceTree = "<group>"; };
@@ -387,6 +389,7 @@
387389
63EAA4E9259944340046AB8F /* Common */ = {
388390
isa = PBXGroup;
389391
children = (
392+
D93F95C02E0C8C1A00238FB5 /* TagView.swift */,
390393
CAC281CC259F97FA00B8AB0B /* ObservingProgressIndicator.swift */,
391394
63EAA4EA259944450046AB8F /* ProgressButton.swift */,
392395
CA452BAF259FD9770072DFA4 /* ProgressIndicator.swift */,
@@ -932,6 +935,7 @@
932935
E84E4F522B323A5F003F3959 /* CornerRadiusModifier.swift in Sources */,
933936
B0403CF22AD934B600137C09 /* CompatibilityView.swift in Sources */,
934937
B0403CFE2ADA712C00137C09 /* InfoPaneControls.swift in Sources */,
938+
D93F95C12E0C8C1A00238FB5 /* TagView.swift in Sources */,
935939
53CBAB2C263DCC9100410495 /* XcodesAlert.swift in Sources */,
936940
332807412CA5EA820036F691 /* SignInSecurityKeyTouchView.swift in Sources */,
937941
CA61A6E0259835580008926E /* Xcode.swift in Sources */,
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//
2+
// TagView.swift
3+
// Xcodes
4+
//
5+
// Created by Matt Kiazyk on 2025-06-25.//
6+
7+
8+
import SwiftUI
9+
10+
struct TagView: View {
11+
let text: String
12+
13+
var body: some View {
14+
Text(text)
15+
.font(.system(size: 10))
16+
.foregroundColor(.primary)
17+
.padding(.horizontal, 5)
18+
.padding(.vertical, 2)
19+
.background(
20+
Capsule()
21+
.fill(.quaternary)
22+
)
23+
}
24+
}

Xcodes/Frontend/InfoPane/PlatformsView.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct PlatformsView: View {
2323
}
2424
}
2525

26-
ForEach(runtimes ?? [], id: \.simulatorVersion.buildUpdate) { runtime in
26+
ForEach(runtimes ?? [], id: \.identifier) { runtime in
2727
runtimeView(runtime: runtime)
2828
.frame(minWidth: 200)
2929
.padding()
@@ -39,6 +39,9 @@ struct PlatformsView: View {
3939
runtime.icon()
4040
Text("\(runtime.visibleIdentifier)")
4141
.font(.headline)
42+
ForEach(runtime.architectures ?? [], id: \.self) { architecture in
43+
TagView(text: architecture)
44+
}
4245
pathIfAvailable(xcode: xcode, runtime: runtime)
4346

4447
if runtime.installState == .notInstalled {

Xcodes/Resources/Licenses.rtf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{\rtf1\ansi\ansicpg1252\cocoartf2818
1+
{\rtf1\ansi\ansicpg1252\cocoartf2822
22
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 .SFNS-Regular;}
33
{\colortbl;\red255\green255\blue255;}
44
{\*\expandedcolortbl;;}

Xcodes/XcodesKit/Sources/XcodesKit/Models/Runtimes/Runtimes.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public struct DownloadableRuntime: Codable, Identifiable, Hashable {
1212
public let category: Category
1313
public let simulatorVersion: SimulatorVersion
1414
public let source: String?
15+
public let architectures: [String]?
1516
public let dictionaryVersion: Int
1617
public let contentType: ContentType
1718
public let platform: Platform
@@ -49,10 +50,11 @@ public struct DownloadableRuntime: Codable, Identifiable, Hashable {
4950
case name
5051
case authentication
5152
case sdkBuildUpdate
53+
case architectures
5254
}
5355

5456
var betaNumber: Int? {
55-
enum Regex { static let shared = try! NSRegularExpression(pattern: "b[0-9]+$") }
57+
enum Regex { static let shared = try! NSRegularExpression(pattern: "b[0-9]+") }
5658
guard var foundString = Regex.shared.firstString(in: identifier) else { return nil }
5759
foundString.removeFirst()
5860
return Int(foundString)!
@@ -94,6 +96,7 @@ public struct SDKToSimulatorMapping: Codable {
9496
public let sdkBuildUpdate: String
9597
public let simulatorBuildUpdate: String
9698
public let sdkIdentifier: String
99+
public let downloadableIdentifiers: [String]?
97100
}
98101

99102
extension DownloadableRuntime {

0 commit comments

Comments
 (0)