Commit 297b487
authored
[Commands] Migrate: Avoid injecting feature settings into every Swift… (#8700)
… module
### Motivation:
Previously the feature flags in `:migrate` mode were injected globally
into "destination" parameter and affected every module in the graph,
this is technically harmless but creates a lot of noise and precludes
some of the future optimizations i.e. avoid injecting `@concurrent` into
some closure literals when context is already `@concurrent`.
Instead of using build parameters, let's make the `Module.buildSettings`
mutable in SwiftPM package and inject feature settings directly into
`buildSettings` of the user-requested or all root package modules
instead.
### Modifications:
- Make `Module.buildSettings` to be a `package(set) var` instead of a
`let` to allow for mutation my migration command.
- Update `Migrate` command to inject the requested upcoming/experimental
features in `:migrate` mode only into request targets or all non-plugin
modules of root packages.
### Result:
No more global build flags and extraneous warnings from dependency
modules that shouldn't have migration enabled.1 parent 43aa87a commit 297b487
File tree
2 files changed
+33
-14
lines changed- Sources
- Commands/PackageCommands
- PackageModel/Module
2 files changed
+33
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
| |||
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
| 152 | + | |
151 | 153 | | |
152 | 154 | | |
153 | 155 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
166 | 181 | | |
167 | 182 | | |
168 | 183 | | |
| |||
171 | 186 | | |
172 | 187 | | |
173 | 188 | | |
174 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
175 | 194 | | |
176 | 195 | | |
177 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
| 234 | + | |
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| |||
0 commit comments