Modern Apps git

← xtool.git

Support unxipping Xcode betas (#115)

Commit
bf057263cc84f9601cf93948aa87807188e524ae
Author
Kabir Oberai <[email protected]>
When
2025-06-10 21:09 UTC (1 year ago)
Parents
9e80b7d
Xcode betas are stored in the xip as Xcode-beta.app. Support this by
avoiding hardcoding the `Xcode.app` path.

Diff

Sources/XToolSupport/SDKBuilder.swift
diff --git a/Sources/XToolSupport/SDKBuilder.swift b/Sources/XToolSupport/SDKBuilder.swiftindex 40b2dd3..f78cfd2 100644--- a/Sources/XToolSupport/SDKBuilder.swift+++ b/Sources/XToolSupport/SDKBuilder.swift@@ -238,7 +238,19 @@ struct SDKBuilder {                 try await extractXIP(inputPath: inputPath, outDir: devStage.path)             }.value             try Task.checkCancellation()-            appDir = devStage.appendingPathComponent("Xcode.app")+            let contents = try FileManager.default.contentsOfDirectory(+                at: devStage,+                includingPropertiesForKeys: nil+            )+            let apps = contents.filter { $0.pathExtension == "app" }+            switch apps.count {+            case 0:+                throw Console.Error("Unrecognized xip layout (Xcode.app not found)")+            case 1:+                appDir = apps[0]+            default:+                throw Console.Error("Unrecognized xip layout (multiple apps found)")+            }             cleanupStageDir = devStage         case .app(let appPath):             wanted = nil