Skip to content

Commit c1836a7

Browse files
committed
PR Cleanup.
1 parent c153a93 commit c1836a7

3 files changed

Lines changed: 2 additions & 95 deletions

File tree

Xcodes/Backend/AppState+Runtimes.swift

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -65,26 +65,6 @@ extension AppState {
6565
}
6666
}
6767
}
68-
69-
// self.runtimePublishers[runtime.identifier] = downloadRunTimeFull(runtime: runtime)
70-
// .receive(on: DispatchQueue.main)
71-
// .sink(
72-
// receiveCompletion: { [unowned self] completion in
73-
// self.runtimePublishers[runtime.identifier] = nil
74-
// if case let .failure(error) = completion {
75-
// Logger.appState.error("Error downloading runtime: \(error.localizedDescription)")
76-
//// // Prevent setting the app state error if it is an invalid session, we will present the sign in view instead
77-
//// if error as? AuthenticationError != .invalidSession {
78-
//// self.error = error
79-
//// self.presentedAlert = .generic(title: localizeString("Alert.Install.Error.Title"), message: error.legibleLocalizedDescription)
80-
//// }
81-
//// if let index = self.allXcodes.firstIndex(where: { $0.id == id }) {
82-
//// self.allXcodes[index].installState = .notInstalled
83-
//// }
84-
// }
85-
// },
86-
// receiveValue: { _ in }
87-
// )
8868
}
8969

9070
func downloadRunTimeFull(runtime: DownloadableRuntime) async throws {
@@ -126,7 +106,6 @@ extension AppState {
126106
// use runtime.url for final with cookies
127107

128108
// Check to see if the archive is in the expected path in case it was downloaded but failed to install
129-
// let expectedRuntimePath = Path.xcodesApplicationSupport/"\(runtime.name).\(runtime.name.suffix(fromLast: "."))"
130109
let url = URL(string: runtime.source)!
131110
let expectedRuntimePath = Path.xcodesApplicationSupport/"\(url.lastPathComponent)"
132111
// aria2 downloads directly to the destination (instead of into /tmp first) so we need to make sure that the download isn't incomplete
@@ -158,12 +137,6 @@ extension AppState {
158137
return Just(runtime.url)
159138
.setFailureType(to: Error.self)
160139
.eraseToAnyPublisher()
161-
162-
// return downloadRuntimeWithURLSession(
163-
// runtime,
164-
// to: expectedRuntimePath,
165-
// progressChanged: progressChanged
166-
// )
167140
}
168141
}
169142
}

Xcodes/Backend/Environment.swift

Lines changed: 2 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -111,74 +111,9 @@ public struct Shell {
111111

112112
return (progress, publisher)
113113
}
114-
114+
// TODO: Support using aria2 using AysncStream/AsyncSequence
115115
// public var downloadWithAria2Async: (Path, URL, Path, [HTTPCookie]) async throws -> Progress = { aria2Path, url, destination, cookies in
116-
// let process = Process()
117-
// process.executableURL = aria2Path.url
118-
// process.arguments = [
119-
// "--header=Cookie: \(cookies.map { "\($0.name)=\($0.value)" }.joined(separator: "; "))",
120-
// "--max-connection-per-server=16",
121-
// "--split=16",
122-
// "--summaraasdy-interval=1",
123-
// "--stop-with-process=\(ProcessInfo.processInfo.processIdentifier)", // if xcodes quits, stop aria2 process
124-
// "--dir=\(destination.parent.string)",
125-
// "--out=\(destination.basename())",
126-
// "--human-readable=false", // sets the output to use bytes instead of formatting
127-
// url.absoluteString,
128-
// ]
129-
// let stdOutPipe = Pipe()
130-
// process.standardOutput = stdOutPipe
131-
// let stdErrPipe = Pipe()
132-
// process.standardError = stdErrPipe
133-
//
134-
// var progress = Progress()
135-
// progress.kinasdas
136-
// progress.fileOperationKind = .downloadingasdfasd
137-
//
138-
// let observer = NotificationCenter.default.addObserver(
139-
// forName: .NSFileHandleDataAvailable,
140-
// object: nil,
141-
// queue: OperationQueue.main
142-
// ) { note in
143-
// guard
144-
// // This should always be the case for Notification.Name.NSFileHandleDataAvailable
145-
// let handle = note.object as? FileHandle,
146-
// handle === stdOutPipe.fileHandleForReading || handle === stdErrPipe.fileHandleForReading
147-
// else { return }
148-
//
149-
// defer { handle.waitForDataInBackgroundAndNotify() }
150-
//
151-
// let string = String(decoding: handle.availableData, as: UTF8.self)
152-
//
153-
// progress.updateFromAria2(string: string)
154-
// }
155-
//
156-
// stdOutPipe.fileHandleForReading.waitForDataInBackgroundAndNotify()
157-
// stdErrPipe.fileHandleForReading.waitForDataInBackgroundAndNotify()
158-
//
159-
// do {
160-
//
161-
// defer {
162-
// //DispatchQueue.global(qos: .default).async {
163-
// process.waitUntilExit()
164-
//
165-
// NotificationCenter.default.removeObserver(observer, name: .NSFileHandleDataAvailable, object: nil)
166-
//
167-
// guard process.terminationReason == .exit, process.terminationStatus == 0 else {
168-
// if let aria2cError = Aria2CError(exitStatus: process.terminationStatus) {
169-
// throw aria2cError
170-
// } else {
171-
// throw ProcessExecutionError(process: process, standardOutput: "", standardError: "")
172-
// }
173-
// }
174-
// return
175-
// }
176-
// }
177-
// try process.run()
178-
// } catch {
179-
// throw error
180-
// }
181-
// }
116+
182117

183118
public var unxipExperiment: (URL) -> AnyPublisher<ProcessOutput, Error> = { url in
184119
let unxipPath = Path(url: Bundle.main.url(forAuxiliaryExecutable: "unxip")!)!

Xcodes/Frontend/InfoPane/RuntimesView.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ struct RuntimesView: View {
2424
$0.sdkBuildUpdate == sdkBuild
2525
}
2626
}
27-
// let runtimes = appState.getRunTimes(xcode: xcode)
2827

2928
ForEach(runtimes ?? [], id: \.simulatorVersion.buildUpdate) { runtime in
3029
VStack {

0 commit comments

Comments
 (0)