Skip to content

Commit e9e5710

Browse files
committed
[BuildSystem] Add diagnosticFiles to a module build description
This would make it possible to access diagnostic files through a generic build system interface.
1 parent 9201534 commit e9e5710

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Sources/Build/BuildDescription/ModuleBuildDescription.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,14 @@ public enum ModuleBuildDescription: SPMBuildCore.ModuleBuildDescription {
140140
}
141141
}
142142

143+
public var diagnosticFiles: [AbsolutePath] {
144+
switch self {
145+
case .swift(let buildDescription):
146+
buildDescription.diagnosticFiles
147+
case .clang(_):
148+
[]
149+
}
150+
}
143151
/// Determines the arguments needed to run `swift-symbolgraph-extract` for
144152
/// this module.
145153
public func symbolGraphExtractArguments() throws -> [String] {

Sources/SPMBuildCore/BuildSystem/BuildSystem.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ public protocol ModuleBuildDescription {
9292
/// The build parameters.
9393
var buildParameters: BuildParameters { get }
9494

95+
/// The diagnostic file locations for all the source files
96+
/// associated with this module.
97+
var diagnosticFiles: [AbsolutePath] { get }
98+
9599
/// FIXME: This shouldn't be necessary and ideally
96100
/// there should be a way to ask build system to
97101
/// introduce these arguments while building for symbol

0 commit comments

Comments
 (0)