Skip to content

Commit 50c880e

Browse files
jakepetroulesbkhouri
authored andcommitted
rdar://140803184 (Update path to xcbuild tool to account for swbuild rename)
This allows --build-system xcode to work again until --build-system next is ready.
1 parent 71ab073 commit 50c880e

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

Sources/XCBuildSupport/XcodeBuildSystem.swift

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,19 @@ public final class XcodeBuildSystem: SPMBuildCore.BuildSystem {
100100
} else {
101101
let xcodeSelectOutput = try AsyncProcess.popen(args: "xcode-select", "-p").utf8Output().spm_chomp()
102102
let xcodeDirectory = try AbsolutePath(validating: xcodeSelectOutput)
103-
xcbuildPath = try AbsolutePath(
104-
validating: "../SharedFrameworks/XCBuild.framework/Versions/A/Support/xcbuild",
105-
relativeTo: xcodeDirectory
106-
)
103+
xcbuildPath = try {
104+
let newPath = try AbsolutePath(
105+
validating: "../SharedFrameworks/SwiftBuild.framework/Versions/A/Support/swbuild",
106+
relativeTo: xcodeDirectory
107+
)
108+
if fileSystem.exists(newPath) {
109+
return newPath
110+
}
111+
return try AbsolutePath(
112+
validating: "../SharedFrameworks/XCBuild.framework/Versions/A/Support/xcbuild",
113+
relativeTo: xcodeDirectory
114+
)
115+
}()
107116
}
108117

109118
guard fileSystem.exists(xcbuildPath) else {

0 commit comments

Comments
 (0)