Skip to content

Commit 9306b79

Browse files
authored
Invoke build tool plugins based on allTargets (#6776)
Currently, we're only invoking build tool plugins for reachable targets which does not seem correct based on the fact that we're willing to build targets out of reachable, e.g. when executing a command plugin. rdar://113264168
1 parent f700420 commit 9306b79

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/SPMBuildCore/PluginInvocation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ extension PackageGraph {
338338
builtToolHandler: (_ name: String, _ path: RelativePath) throws -> AbsolutePath? = { _, _ in return nil }
339339
) throws -> [ResolvedTarget: [BuildToolPluginInvocationResult]] {
340340
var pluginResultsByTarget: [ResolvedTarget: [BuildToolPluginInvocationResult]] = [:]
341-
for target in self.reachableTargets.sorted(by: { $0.name < $1.name }) {
341+
for target in self.allTargets.sorted(by: { $0.name < $1.name }) {
342342
// Infer plugins from the declared dependencies, and collect them as well as any regular dependencies. Although usage of build tool plugins is declared separately from dependencies in the manifest, in the internal model we currently consider both to be dependencies.
343343
var pluginTargets: [PluginTarget] = []
344344
var dependencyTargets: [Target] = []

0 commit comments

Comments
 (0)