You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[6.2] Fixes a few issues with swift package {migrate, add-setting} commands (#8812)
Cherry-pick of
#8800,
#8806
### Motivation:
Fixes for the following problems:
- Sometimes if the previous build was unsuccessful subsequent `swift
package migrate` invocation fails with `error: did not compute a build
plan yet`.
- Implicitly generated targets (currently only test targets) are
included in migration which results in extraneous warnings and failures
(i.e. to update the manifest).
The inconsistency in argument formatting came up as part of SE-0486
review. This is the first step in a direction to make command formatting
more consistent.
- `swift package migrate`:
- Rename `--targets` to `--target`
- Change `--target` and `--to-feature` to accept space separated
argument lists
- `swift package -add-setting`:
- Switch to `.upToNextOption` formatting. Instead of `--swift A=B
--swift C=D` switch to `--swift A=B C=D`.
### Modifications:
- Update `Migrate` command's `createBuildSystem` API to avoid build
manifest caching. That ensures that features in migration mode are never
persistent and requires a fresh build plan which avoid issues with
previous builds.
- Make it possible to mark a `Module` as `implicit` i.e. when it's a
synthesized/discovered test target or a system module.
- Update `Migrate` command to filter `implicit` modules when no targets
are specified by the user.
- Update `MigrateOptions` to use `.upToNextOption` for targets and
features.
- Update `SwiftPackageCommand`'s `_swiftSettings` option to use
`.upToNextOption`
### Result:
`swift package migrate` is made more stable with fewer unactionable
warnings and errors and the command line is now shorter and has
consistent formatting.
Resolves: rdar://152687586
Resolves: rdar://152689053
Resolves: rdar://152687084
0 commit comments