File tree Expand file tree Collapse file tree 2 files changed +29
-9
lines changed
Expand file tree Collapse file tree 2 files changed +29
-9
lines changed Original file line number Diff line number Diff line change @@ -202,15 +202,33 @@ public final class Manifest: ObjectIdentifierProtocol {
202202 let productTargetNames = products. flatMap ( { $0. targets } )
203203
204204 let dependentTargetNames = transitiveClosure ( productTargetNames, successors: { targetName in
205- targetsByName [ targetName] ? . dependencies. compactMap ( { dependency in
206- switch dependency {
207- case . target( let name, _) ,
208- . byName( let name, _) :
209- return targetsByName. keys. contains ( name) ? name : nil
210- default :
211- return nil
205+
206+ if let target = targetsByName [ targetName] {
207+ let dependencies : [ String ] = target. dependencies. compactMap { dependency in
208+ switch dependency {
209+ case . target( let name, _) ,
210+ . byName( let name, _) :
211+ return targetsByName. keys. contains ( name) ? name : nil
212+ default :
213+ return nil
214+ }
212215 }
213- } ) ?? [ ]
216+
217+ let plugins : [ String ] = target. pluginUsages? . compactMap { pluginUsage in
218+ switch pluginUsage {
219+ case . plugin( name: let name, package : nil ) :
220+ return targetsByName. keys. contains ( name) ? name : nil
221+ default :
222+ return nil
223+ }
224+ } ?? [ ]
225+
226+ return dependencies + plugins
227+ }
228+
229+ return [ ]
230+
231+
214232 } )
215233
216234 let requiredTargetNames = Set ( productTargetNames) . union ( dependentTargetNames)
Original file line number Diff line number Diff line change @@ -22,8 +22,9 @@ class ManifestTests: XCTestCase {
2222 let targets = [
2323 try TargetDescription ( name: " Foo " , dependencies: [ " Bar " ] ) ,
2424 try TargetDescription ( name: " Bar " , dependencies: [ " Baz " ] ) ,
25- try TargetDescription ( name: " Baz " , dependencies: [ ] ) ,
25+ try TargetDescription ( name: " Baz " , dependencies: [ " MyPlugin " ] ) ,
2626 try TargetDescription ( name: " FooBar " , dependencies: [ ] ) ,
27+ try TargetDescription ( name: " MyPlugin " , type: . plugin, pluginCapability: . buildTool)
2728 ]
2829
2930 do {
@@ -41,6 +42,7 @@ class ManifestTests: XCTestCase {
4142 " Baz " ,
4243 " Foo " ,
4344 " FooBar " ,
45+ " MyPlugin "
4446 ] )
4547 }
4648
You can’t perform that action at this time.
0 commit comments