File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -104,11 +104,8 @@ public final class XcodeBuildSystem: SPMBuildCore.BuildSystem {
104
104
arguments += buildParameters. xcbuildFlags
105
105
106
106
let delegate = createBuildDelegate ( )
107
- let redirection : Process . OutputRedirection = . stream( stdout: delegate. parse ( bytes: ) , stderr: { bytes in
108
- self . diagnostics. emit ( StringError ( String ( bytes: bytes, encoding: . utf8) !) )
109
- } )
110
-
111
- let process = Process ( arguments: arguments, outputRedirection: redirection)
107
+
108
+ let process = Process ( arguments: arguments, outputRedirection: . collect)
112
109
try process. launch ( )
113
110
let result = try process. waitUntilExit ( )
114
111
@@ -119,6 +116,14 @@ public final class XcodeBuildSystem: SPMBuildCore.BuildSystem {
119
116
guard result. exitStatus == . terminated( code: 0 ) else {
120
117
throw Diagnostics . fatalError
121
118
}
119
+
120
+ let stdout = try result. output. get ( )
121
+ if !stdout. isEmpty {
122
+ try delegate. parse ( bytes: result. output. get ( ) )
123
+ } else {
124
+ let stderr = try result. utf8stderrOutput ( )
125
+ self . diagnostics. emit ( StringError ( stderr) )
126
+ }
122
127
}
123
128
124
129
func createBuildParametersFile( ) throws -> AbsolutePath ? {
You can’t perform that action at this time.
0 commit comments