Skip to content

Commit 8696925

Browse files
committed
cleanup
1 parent 3103596 commit 8696925

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Sources/XCBuildSupport/XcodeBuildSystem.swift

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,6 @@ public final class XcodeBuildSystem: SPMBuildCore.BuildSystem {
103103

104104
arguments += buildParameters.xcbuildFlags
105105

106-
let delegate = createBuildDelegate()
107-
108106
let process = Process(arguments: arguments, outputRedirection: .collect)
109107
try process.launch()
110108
let result = try process.waitUntilExit()
@@ -119,10 +117,15 @@ public final class XcodeBuildSystem: SPMBuildCore.BuildSystem {
119117

120118
let stdout = try result.output.get()
121119
if !stdout.isEmpty {
122-
try delegate.parse(bytes: result.output.get())
120+
let delegate = createBuildDelegate()
121+
delegate.parse(bytes: stdout)
123122
} else {
124123
let stderr = try result.utf8stderrOutput()
125-
self.diagnostics.emit(StringError(stderr))
124+
if !stderr.isEmpty {
125+
diagnostics.emit(StringError(stderr))
126+
} else {
127+
diagnostics.emit(StringError("Unknown error: stdout and stderr are empty"))
128+
}
126129
}
127130
}
128131

0 commit comments

Comments
 (0)