Reverts "[SwiftPM] Turn on by default (#161275)" (#161339)

<!-- start_original_pr_link -->
Reverts: flutter/flutter#161275
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: loic-sharma
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: failing post submit check
`[build_ios_framework_module_test](https://ci.chromium.org/ui/p/flutter/builders/prod/Mac_arm64%20build_ios_framework_module_test)

```
[2025-01-08 14:19:48.853336] [STDOUT] stdout:            ** BUILD SUCCEEDED **
[2025-01-08 14:19:50.360684] [STDOUT] stdout: [+1522 ms]  ├─Building plugins... (completed in 4.8s)
[2025-01-08 14:19:50.360824] [STDOUT] stdout: [       
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: loic-sharma
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {cbracken, vashworth, jmagman}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:
This turns on Swift Package Manager by default:

1. New apps will have Swift Package Manager integration
2. New plugins will support Swift Package Manager
3. Existing apps will continue to use CocoaPods. They can migrate to SwiftPM using `flutter config --enable-swift-package-manager-migration`.

See this mini design doc: https://github.com/flutter/flutter/issues/151567#issuecomment-2455941279

Here's the PR that updates the SwiftPM docs: https://github.com/flutter/website/pull/11495

Part of https://github.com/flutter/flutter/issues/151567

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is [test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on [Discord].

<!-- Links -->
[Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
This commit is contained in:
auto-submit[bot] 2025-01-08 22:54:47 +00:00 committed by GitHub
parent d9342ae870
commit 05899f84c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 17 additions and 18 deletions

View File

@ -15,10 +15,6 @@ Future<void> main() async {
await task(() async {
final Directory tempDir = Directory.systemTemp.createTempSync('flutter_plugin_test.');
try {
section('Use CocoaPods');
await flutter('config', options: <String>['--no-enable-swift-package-manager']);
section('Lint integration_test');
await inDirectory(tempDir, () async {

View File

@ -52,7 +52,7 @@ abstract class FeatureFlags {
bool get isPreviewDeviceEnabled => true;
/// Whether Swift Package Manager dependency management is enabled.
bool get isSwiftPackageManagerEnabled => true;
bool get isSwiftPackageManagerEnabled => false;
/// Whether apps are automatically migrated to add Swift Package Manager
/// integration. Requires [isSwiftPackageManagerEnabled].
@ -174,10 +174,13 @@ const Feature previewDevice = Feature(
);
/// Enable Swift Package Manager as a darwin dependency manager.
const Feature swiftPackageManager = Feature.fullyEnabled(
const Feature swiftPackageManager = Feature(
name: 'support for Swift Package Manager for iOS and macOS',
configSetting: 'enable-swift-package-manager',
environmentOverride: 'FLUTTER_SWIFT_PACKAGE_MANAGER',
master: FeatureChannelSetting(available: true),
beta: FeatureChannelSetting(available: true),
stable: FeatureChannelSetting(available: true),
);
/// Enable migrating iOS and macOS apps to add Swift Package Manager integration.

View File

@ -410,12 +410,12 @@ void main() {
group('Swift Package Manager feature', () {
testWithoutContext('availability and default enabled', () {
expect(swiftPackageManager.master.enabledByDefault, isTrue);
expect(swiftPackageManager.master.available, isTrue);
expect(swiftPackageManager.beta.enabledByDefault, isTrue);
expect(swiftPackageManager.beta.available, isTrue);
expect(swiftPackageManager.stable.enabledByDefault, isTrue);
expect(swiftPackageManager.stable.available, isTrue);
expect(swiftPackageManager.master.enabledByDefault, false);
expect(swiftPackageManager.master.available, true);
expect(swiftPackageManager.beta.enabledByDefault, false);
expect(swiftPackageManager.beta.available, true);
expect(swiftPackageManager.stable.enabledByDefault, false);
expect(swiftPackageManager.stable.available, true);
});
testWithoutContext('can be enabled', () {
@ -427,12 +427,12 @@ void main() {
group('Swift Package Manager app migration feature', () {
testWithoutContext('availability and default enabled', () {
expect(swiftPackageManagerMigration.master.enabledByDefault, isFalse);
expect(swiftPackageManagerMigration.master.available, isTrue);
expect(swiftPackageManagerMigration.beta.enabledByDefault, isFalse);
expect(swiftPackageManagerMigration.beta.available, isTrue);
expect(swiftPackageManagerMigration.stable.enabledByDefault, isFalse);
expect(swiftPackageManagerMigration.stable.available, isTrue);
expect(swiftPackageManagerMigration.master.enabledByDefault, false);
expect(swiftPackageManagerMigration.master.available, true);
expect(swiftPackageManagerMigration.beta.enabledByDefault, false);
expect(swiftPackageManagerMigration.beta.available, true);
expect(swiftPackageManagerMigration.stable.enabledByDefault, false);
expect(swiftPackageManagerMigration.stable.available, true);
});
testWithoutContext('requires Swift Package Manager feature', () {