Skip to content

Commit f73c0c7

Browse files
authored
Further alignment of preliminary implementation with SE-0303 proposal (#3312)
Move the usage of plugins from the `dependencies` parameter of targets in the package manifest to instead be in a separate `plugins` parameter. Despite their similarity to dependencies we want users to consider them differently. This also leaves room to grow in the future, when plugin usage might support parameters, etc. We encode them separately in the manifest JSON, but merge them into regular dependencies to avoid duplicated implementation on the SwiftPM side. This can be changed later without affecting clients. For now it would just mean duplicate code. rdar://74663667
1 parent b6d4c92 commit f73c0c7

File tree

7 files changed

+419
-26
lines changed

7 files changed

+419
-26
lines changed

Fixtures/Miscellaneous/Plugins/MySourceGenClient/Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ let package = Package(
1717
// A unit that uses the plugin.
1818
.testTarget(
1919
name: "MyTests",
20-
dependencies: [
21-
.product(name: "MySourceGenPlugin", package: "MySourceGenPlugin")
20+
plugins: [
21+
.plugin(name: "MySourceGenPlugin", package: "MySourceGenPlugin")
2222
]
2323
)
2424
]

Fixtures/Miscellaneous/Plugins/MySourceGenPlugin/Package.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ let package = Package(
4949
.testTarget(
5050
name: "MySourceGenPluginTests",
5151
dependencies: [
52-
"MySourceGenPlugin",
5352
"MySourceGenRuntimeLib"
53+
],
54+
plugins: [
55+
"MySourceGenPlugin"
5456
]
5557
)
5658
]

0 commit comments

Comments
 (0)