Skip to content

Commit c5127ee

Browse files
committed
Adds small documentation to new functions added
1 parent 66c012b commit c5127ee

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

Sources/XcodesKit/RuntimeInstaller.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ public class RuntimeInstaller {
3838
}
3939
}
4040

41-
42-
43-
4441
installed.forEach { runtime in
4542
let resolvedBetaNumber = downloadablesResponse.sdkToSeedMappings.first {
4643
$0.buildUpdate == runtime.build
@@ -242,6 +239,8 @@ public class RuntimeInstaller {
242239
}
243240
}
244241

242+
/// Checks the existing `xcodebuild -version` to ensure that the version is appropriate to use for downloading the cryptex style 16.1+ downloads
243+
/// otherwise will throw an error
245244
private func ensureSelectedXcodeVersionForDownload() async throws {
246245
let xcodeBuildPath = Path.root.usr.bin.join("xcodebuild")
247246
let versionString = try await Process.run(xcodeBuildPath, "-version").async()
@@ -255,13 +254,15 @@ public class RuntimeInstaller {
255254
throw Error.noXcodeSelectedFound
256255
}
257256

257+
// actually compare the version against version 16.1 to ensure it's equal or greater
258258
guard version >= Version(16, 1, 0) else {
259259
throw Error.xcode16_1OrGreaterRequired(version)
260260
}
261261

262262
// If we made it here, we're gucci and 16.1 or greater is selected
263263
}
264264

265+
// Creates and invokes the xcodebuild install command and converts it to a stream of Progress
265266
private func createXcodebuildDownloadStream(runtime: DownloadableRuntime) -> AsyncThrowingStream<Progress, Swift.Error> {
266267
let platform = runtime.platform.shortName
267268
let version = runtime.simulatorVersion.buildUpdate

0 commit comments

Comments
 (0)