Skip to content

Commit f3b6192

Browse files
committed
Pass SwiftFormatRules sources as inputs to generate-pipeline-plugin.
This will cause the plug-in to only rerun when the rules files change (without this, it was rerunning on every build).
1 parent 4d1086e commit f3b6192

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Plugins/generate-pipeline-plugin/GeneratePipelinePlugin.swift

+5
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ struct GeneratePipelinePlugin: BuildToolPlugin {
4949
.appending("GeneratedSources")
5050
.appending(generatedSourceName)
5151

52+
let rulesSources =
53+
(try context.package.targets(named: ["SwiftFormatRules"]).first as? SwiftSourceModuleTarget)?
54+
.sourceFiles.map(\.path) ?? []
55+
5256
return [
5357
.buildCommand(
5458
displayName: "Generating \(generatedSourceName) for \(target.name)",
@@ -61,6 +65,7 @@ struct GeneratePipelinePlugin: BuildToolPlugin {
6165
"--target",
6266
target.name,
6367
],
68+
inputFiles: rulesSources,
6469
outputFiles: [outputFile]
6570
)
6671
]

0 commit comments

Comments
 (0)