-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Runtime/Platforms Downloading and Install 🚀 #448
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
// self.runtimePublishers[runtime.identifier] = downloadRunTimeFull(runtime: runtime) | ||
// .receive(on: DispatchQueue.main) | ||
// .sink( | ||
// receiveCompletion: { [unowned self] completion in | ||
// self.runtimePublishers[runtime.identifier] = nil | ||
// if case let .failure(error) = completion { | ||
// Logger.appState.error("Error downloading runtime: \(error.localizedDescription)") | ||
//// // Prevent setting the app state error if it is an invalid session, we will present the sign in view instead | ||
//// if error as? AuthenticationError != .invalidSession { | ||
//// self.error = error | ||
//// self.presentedAlert = .generic(title: localizeString("Alert.Install.Error.Title"), message: error.legibleLocalizedDescription) | ||
//// } | ||
//// if let index = self.allXcodes.firstIndex(where: { $0.id == id }) { | ||
//// self.allXcodes[index].installState = .notInstalled | ||
//// } | ||
// } | ||
// }, | ||
// receiveValue: { _ in } | ||
// ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we leave this in with a todo comment or remove it entirely?
@@ -112,6 +112,74 @@ public struct Shell { | |||
return (progress, publisher) | |||
} | |||
|
|||
// public var downloadWithAria2Async: (Path, URL, Path, [HTTPCookie]) async throws -> Progress = { aria2Path, url, destination, cookies in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a TODO here or remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added TODO to support Aria 2 with AsyncStream/Sequence
$0.sdkBuildUpdate == sdkBuild | ||
} | ||
} | ||
// let runtimes = appState.getRunTimes(xcode: xcode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed?
Network change error makes PS: How about a installing status text or cancel button instead of the install button when installing. Thanks for your nice work! |
@hstdt thanks for the feedback. Going to work on supporting cancelling for runtimes in a future PR as I def missed that in this pr. |
Can't wait for you to release! So excited! |
With Apple's change of splitting out the runtimes outside the of the main Xcode download, we need to support that in Xcodes so that users can still feel the speed and ease of downloading GB more of required data
The Xcode CLI had support for this for a while.. sorry it took long to get this in.
What's new
XcodesKit
I started splitting out shared code into a new package called... XcodesKit so that, in the future, both CLI and UI can reuse the same code. Currently there's a lot of duplicated code. There are lots of shell calls that are exactly the same for both.
Any new code that can be shared between the 2 should be moved to XcodesKit when at all possible
Runtime Download
Xcodes CLI currently only uses the current selected Xcode to determine if it's installed. Anytime you have multiple Xcodes installed, it doesn't do a great job of showing you what other runtimes are installed.
This PR includes code that uses
/Library/Developer/CoreSimulator/Images
(where the downloaded runtimes exist) to determine whether or not you have that it installed.I'm still working on tweaking the UI for downloading but currently looks like:
This code started in June - so please give it a run if you have time.