mirror of
https://github.com/XcodesOrg/XcodesApp.git
synced 2026-04-27 15:07:39 +00:00
Merge branch 'main' into matt/cryptexRuntimeDownloads
This commit is contained in:
commit
c31a1ef6fa
7 changed files with 146 additions and 14 deletions
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
|
|
@ -8,10 +8,10 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: macos-13
|
runs-on: macos-14
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
env:
|
env:
|
||||||
DEVELOPER_DIR: /Applications/Xcode_15.0.1.app
|
DEVELOPER_DIR: /Applications/Xcode_16.app
|
||||||
run: xcodebuild test -scheme Xcodes
|
run: xcodebuild test -scheme Xcodes
|
||||||
|
|
|
||||||
|
|
@ -436,6 +436,11 @@ class AppState: ObservableObject {
|
||||||
guard let availableXcode = availableXcodes.first(where: { $0.version == id }) else { return }
|
guard let availableXcode = availableXcodes.first(where: { $0.version == id }) else { return }
|
||||||
|
|
||||||
installationPublishers[id] = signInIfNeeded()
|
installationPublishers[id] = signInIfNeeded()
|
||||||
|
.handleEvents(
|
||||||
|
receiveSubscription: { [unowned self] _ in
|
||||||
|
self.setInstallationStep(of: availableXcode.version, to: .authenticating)
|
||||||
|
}
|
||||||
|
)
|
||||||
.flatMap { [unowned self] in
|
.flatMap { [unowned self] in
|
||||||
// signInIfNeeded might finish before the user actually authenticates if UI is involved.
|
// signInIfNeeded might finish before the user actually authenticates if UI is involved.
|
||||||
// This publisher will wait for the @Published authentication state to change to authenticated or unauthenticated before finishing,
|
// This publisher will wait for the @Published authentication state to change to authenticated or unauthenticated before finishing,
|
||||||
|
|
|
||||||
|
|
@ -35,12 +35,11 @@ struct XcodeCommands: Commands {
|
||||||
|
|
||||||
struct InstallButton: View {
|
struct InstallButton: View {
|
||||||
@EnvironmentObject var appState: AppState
|
@EnvironmentObject var appState: AppState
|
||||||
@State private var isLoading = false
|
|
||||||
|
|
||||||
let xcode: Xcode?
|
let xcode: Xcode?
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ProgressButton(isInProgress: isLoading) {
|
Button {
|
||||||
install()
|
install()
|
||||||
} label: {
|
} label: {
|
||||||
Text("Install")
|
Text("Install")
|
||||||
|
|
@ -49,7 +48,6 @@ struct InstallButton: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
private func install() {
|
private func install() {
|
||||||
isLoading = true
|
|
||||||
guard let xcode = xcode else { return }
|
guard let xcode = xcode else { return }
|
||||||
appState.checkMinVersionAndInstall(id: xcode.id)
|
appState.checkMinVersionAndInstall(id: xcode.id)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ struct InstallationStepDetailView: View {
|
||||||
showsAdditionalDescription: true
|
showsAdditionalDescription: true
|
||||||
)
|
)
|
||||||
|
|
||||||
case .unarchiving, .moving, .trashingArchive, .checkingSecurity, .finishing:
|
case .authenticating, .unarchiving, .moving, .trashingArchive, .checkingSecurity, .finishing:
|
||||||
ProgressView()
|
ProgressView()
|
||||||
.scaleEffect(0.5)
|
.scaleEffect(0.5)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ struct InstallationStepRowView: View {
|
||||||
controlSize: .small,
|
controlSize: .small,
|
||||||
style: .spinning
|
style: .spinning
|
||||||
)
|
)
|
||||||
case .unarchiving, .moving, .trashingArchive, .checkingSecurity, .finishing:
|
case .authenticating, .unarchiving, .moving, .trashingArchive, .checkingSecurity, .finishing:
|
||||||
ProgressView()
|
ProgressView()
|
||||||
.scaleEffect(0.5)
|
.scaleEffect(0.5)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4446,6 +4446,131 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"Authenticating" : {
|
||||||
|
"extractionState" : "manual",
|
||||||
|
"localizations" : {
|
||||||
|
"ar" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "Authenticating"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ca" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "Authenticating"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"de" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "Authenticating"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"el" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "Authenticating"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"en" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "Authenticating"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"es" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "Authenticating"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"fi" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "Authenticating"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"fr" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "Authenticating"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"hi" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "Authenticating"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"it" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "Authenticating"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ja" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "認証中"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ko" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "Authenticating"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nl" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "Authenticating"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"pl" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "Authenticating"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"pt-BR" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "Authenticating"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ru" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "Authenticating"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tr" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "Authenticating"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uk" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "Authenticating"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zh-Hans" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "Authenticating"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zh-Hant" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "Authenticating"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"AutomaticallyCreateSymbolicLink" : {
|
"AutomaticallyCreateSymbolicLink" : {
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
"ar" : {
|
"ar" : {
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import Foundation
|
||||||
|
|
||||||
// A numbered step
|
// A numbered step
|
||||||
public enum XcodeInstallationStep: Equatable, CustomStringConvertible {
|
public enum XcodeInstallationStep: Equatable, CustomStringConvertible {
|
||||||
|
case authenticating
|
||||||
case downloading(progress: Progress)
|
case downloading(progress: Progress)
|
||||||
case unarchiving
|
case unarchiving
|
||||||
case moving(destination: String)
|
case moving(destination: String)
|
||||||
|
|
@ -22,6 +23,8 @@ public enum XcodeInstallationStep: Equatable, CustomStringConvertible {
|
||||||
|
|
||||||
public var message: String {
|
public var message: String {
|
||||||
switch self {
|
switch self {
|
||||||
|
case .authenticating:
|
||||||
|
return localizeString("Authenticating")
|
||||||
case .downloading:
|
case .downloading:
|
||||||
return localizeString("Downloading")
|
return localizeString("Downloading")
|
||||||
case .unarchiving:
|
case .unarchiving:
|
||||||
|
|
@ -39,16 +42,17 @@ public enum XcodeInstallationStep: Equatable, CustomStringConvertible {
|
||||||
|
|
||||||
public var stepNumber: Int {
|
public var stepNumber: Int {
|
||||||
switch self {
|
switch self {
|
||||||
case .downloading: return 1
|
case .authenticating: return 1
|
||||||
case .unarchiving: return 2
|
case .downloading: return 2
|
||||||
case .moving: return 3
|
case .unarchiving: return 3
|
||||||
case .trashingArchive: return 4
|
case .moving: return 4
|
||||||
case .checkingSecurity: return 5
|
case .trashingArchive: return 5
|
||||||
case .finishing: return 6
|
case .checkingSecurity: return 6
|
||||||
|
case .finishing: return 7
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public var stepCount: Int { 6 }
|
public var stepCount: Int { 7 }
|
||||||
}
|
}
|
||||||
|
|
||||||
func localizeString(_ key: String, comment: String = "") -> String {
|
func localizeString(_ key: String, comment: String = "") -> String {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue