Support Runtime/Platforms Downloading and Install 🚀 #448
Merged
MattKiazyk merged 9 commits intomainfrom Dec 1, 2023
Merged
Conversation
guitaripod
approved these changes
Nov 23, 2023
Comment on lines
69
to
87
| // 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.
Should we leave this in with a todo comment or remove it entirely?
| 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.
Should we add a TODO here or remove?
Contributor
Author
There was a problem hiding this comment.
Added TODO to support Aria 2 with AsyncStream/Sequence
| $0.sdkBuildUpdate == sdkBuild | ||
| } | ||
| } | ||
| // let runtimes = appState.getRunTimes(xcode: xcode) |
|
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! |
Contributor
Author
|
@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! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.