Skip to content

Commit 19047d1

Browse files
committed
Stop build if there were build-tool plugin failures
rdar://102989296
1 parent a89e99b commit 19047d1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Sources/Build/BuildOperation.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ public final class BuildOperation: PackageStructureDelegate, SPMBuildCore.BuildS
405405
)
406406

407407
// Surface any diagnostics from build tool plugins.
408+
var succeeded = true
408409
for (target, results) in buildToolPluginInvocationResults {
409410
// There is one result for each plugin that gets applied to a target.
410411
for result in results {
@@ -420,9 +421,14 @@ public final class BuildOperation: PackageStructureDelegate, SPMBuildCore.BuildS
420421
for diag in result.diagnostics {
421422
diagnosticsEmitter.emit(diag)
422423
}
424+
succeeded = succeeded && result.succeeded
423425
}
424426
}
425427

428+
if !succeeded {
429+
throw StringError("build stopped due to build-tool plugin failures")
430+
}
431+
426432
// Run any prebuild commands provided by build tool plugins. Any failure stops the build.
427433
let prebuildCommandResults = try graph.reachableTargets.reduce(into: [:], { partial, target in
428434
partial[target] = try buildToolPluginInvocationResults[target].map { try self.runPrebuildCommands(for: $0) }

0 commit comments

Comments
 (0)