[tool] Update Swift Package Manager handling#11234
[tool] Update Swift Package Manager handling#11234auto-submit[bot] merged 3 commits intoflutter:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the repository tooling for Swift Package Manager. It introduces a --swift-package-manager flag (with its negation) to the create-all-packages-app command, allowing explicit control over SPM usage. This new flag is used in CI configurations for ios_build_all_packages and macos_build_all_packages to disable SPM. The change also removes the now-unnecessary logic that disabled SPM during the analyze command for example apps. Corresponding test files are updated to reflect these changes, with new tests for the create-all-packages-app command and removal of obsolete tests for the analyze command.
| test('disables Swift Package Manager if requested', () async { | ||
| writeFakeFlutterCreateOutput(testRoot); | ||
| createFakePlugin('plugina', packagesDir); | ||
|
|
||
| await runCapturingPrint(runner, <String>[ | ||
| 'create-all-packages-app', | ||
| '--no-swift-package-manager', | ||
| ]); | ||
|
|
||
| final Pubspec pubspec = command.app.parsePubspec(); | ||
| final flutterConfig = pubspec.flutter?['config'] as YamlMap?; | ||
| expect(flutterConfig?['enable-swift-package-manager'], false); | ||
| }); | ||
|
|
||
| test('enables Swift Package Manager if requested', () async { | ||
| writeFakeFlutterCreateOutput(testRoot); | ||
| createFakePlugin('plugina', packagesDir); | ||
|
|
||
| await runCapturingPrint(runner, <String>[ | ||
| 'create-all-packages-app', | ||
| '--swift-package-manager', | ||
| ]); | ||
|
|
||
| final Pubspec pubspec = command.app.parsePubspec(); | ||
| final flutterConfig = pubspec.flutter?['config'] as YamlMap?; | ||
| expect(flutterConfig?['enable-swift-package-manager'], true); | ||
| }); |
There was a problem hiding this comment.
These two tests are very similar and contain duplicated setup code. To improve readability and reduce duplication, you could group them under a group and use a setUp block for the common initialization.
group('Swift Package Manager flag', () {
setUp(() {
writeFakeFlutterCreateOutput(testRoot);
createFakePlugin('plugina', packagesDir);
});
test('disables if requested', () async {
await runCapturingPrint(runner, <String>[
'create-all-packages-app',
'--no-swift-package-manager',
]);
final Pubspec pubspec = command.app.parsePubspec();
final flutterConfig = pubspec.flutter?['config'] as YamlMap?;
expect(flutterConfig?['enable-swift-package-manager'], false);
});
test('enables if requested', () async {
await runCapturingPrint(runner, <String>[
'create-all-packages-app',
'--swift-package-manager',
]);
final Pubspec pubspec = command.app.parsePubspec();
final flutterConfig = pubspec.flutter?['config'] as YamlMap?;
expect(flutterConfig?['enable-swift-package-manager'], true);
});
});|
autosubmit label was removed for flutter/packages/11234, because - The status or check suite Linux_web web_platform_tests_wasm_shard_3 master has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
autosubmit label was removed for flutter/packages/11234, because - The status or check suite Mac_arm64 ios_platform_tests_shard_3 master has failed. Please fix the issues identified (or deflake) before re-applying this label. |
This is the existing IAP flake, unrelated to this PR. |
flutter/packages@02f231f...91f7c33 2026-03-12 engine-flutter-autoroll@skia.org Roll Flutter from 3f400d7 to 9e36adb (21 revisions) (flutter/packages#11233) 2026-03-12 stuartmorgan@google.com [tool] Update Swift Package Manager handling (flutter/packages#11234) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Updates the repo tooling for Swift Package manager being on by default on main, and for analysis now working with Swift Package Manager: - Explicitly disables SwiftPM for the build-all test, instead of relying on it being off by default - No longer disable SwiftPM for example apps before running analysis, since it's no longer necessary to do so, and we don't want to rely on CocoaPods for core tests going forward. Fixes flutter/flutter#183521 Fixes flutter/flutter#172427
…r#183645) flutter/packages@02f231f...91f7c33 2026-03-12 engine-flutter-autoroll@skia.org Roll Flutter from 3f400d7 to 9e36adb (21 revisions) (flutter/packages#11233) 2026-03-12 stuartmorgan@google.com [tool] Update Swift Package Manager handling (flutter/packages#11234) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Updates the repo tooling for Swift Package manager being on by default on main, and for analysis now working with Swift Package Manager:
Fixes flutter/flutter#183521
Fixes flutter/flutter#172427