Skip to content

Commit 36a4dba

Browse files
authored
Rename runCommandPlugins methods to a more accurate name (#9223)
This method is very confusing because it suggests that command plugins will be run during build, which is not the case. Command plugins always run at the user's request using `swift package plugin <name>` outside of a build. Instead, this method should be renamed to reflect that it is running commands that the plugin has generated when it was invoked from a collection of results. Rename the methods in both the SwiftBuildSupport and Build components and update the documentation.
1 parent dd50d0d commit 36a4dba

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Sources/Build/BuildPlan/BuildPlan.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ public class BuildPlan: SPMBuildCore.BuildPlan {
337337
}
338338

339339
buildToolPluginInvocationResults[module.id] = pluginInvocationResults
340-
prebuildCommandResults[module.id] = try Self.runCommandPlugins(
340+
prebuildCommandResults[module.id] = try Self.runPluginCommands(
341341
using: pluginConfiguration,
342342
for: pluginInvocationResults,
343343
fileSystem: fileSystem,
@@ -854,9 +854,9 @@ extension BuildPlan {
854854
return buildToolPluginResults
855855
}
856856

857-
/// Runs any command plugins associated with the given list of plugin invocation results,
857+
/// Runs any commands associated with the given list of plugin invocation results,
858858
/// in order, and returns the results of running those prebuild commands.
859-
fileprivate static func runCommandPlugins(
859+
fileprivate static func runPluginCommands(
860860
using pluginConfiguration: PluginConfiguration,
861861
for pluginResults: [BuildToolPluginInvocationResult],
862862
fileSystem: any FileSystem,

Sources/SwiftBuildSupport/PIFBuilder.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ public final class PIFBuilder {
369369

370370
// Run the prebuild commands generated from the plugin invocation now for this module. This will
371371
// also give use the derived source code files needed for PIF generation.
372-
let runResults = try Self.runCommandPlugins(
372+
let runResults = try Self.runPluginCommands(
373373
using: self.pluginConfiguration,
374374
for: buildToolPluginResults,
375375
fileSystem: fileSystem,
@@ -429,9 +429,9 @@ public final class PIFBuilder {
429429
}
430430
}
431431

432-
/// Runs any command plugins associated with the given list of plugin invocation results,
432+
/// Runs any commands associated with the given list of plugin invocation results,
433433
/// in order, and returns the results of running those prebuild commands.
434-
fileprivate static func runCommandPlugins(
434+
fileprivate static func runPluginCommands(
435435
using pluginConfiguration: PluginConfiguration,
436436
for pluginResults: [BuildToolPluginInvocationResult],
437437
fileSystem: any FileSystem,

0 commit comments

Comments
 (0)