Skip to content

Commit 05899f8

Browse files
auto-submit[bot]auto-submit[bot]
andauthored
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: flutter/flutter#151567 (comment) Here's the PR that updates the SwiftPM docs: flutter/website#11495 Part of flutter/flutter#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] <[email protected]>
1 parent d9342ae commit 05899f8

File tree

3 files changed

+17
-18
lines changed

3 files changed

+17
-18
lines changed

dev/devicelab/bin/tasks/plugin_lint_mac.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ Future<void> main() async {
1515
await task(() async {
1616
final Directory tempDir = Directory.systemTemp.createTempSync('flutter_plugin_test.');
1717
try {
18-
section('Use CocoaPods');
19-
20-
await flutter('config', options: <String>['--no-enable-swift-package-manager']);
21-
2218
section('Lint integration_test');
2319

2420
await inDirectory(tempDir, () async {

packages/flutter_tools/lib/src/features.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ abstract class FeatureFlags {
5252
bool get isPreviewDeviceEnabled => true;
5353

5454
/// Whether Swift Package Manager dependency management is enabled.
55-
bool get isSwiftPackageManagerEnabled => true;
55+
bool get isSwiftPackageManagerEnabled => false;
5656

5757
/// Whether apps are automatically migrated to add Swift Package Manager
5858
/// integration. Requires [isSwiftPackageManagerEnabled].
@@ -174,10 +174,13 @@ const Feature previewDevice = Feature(
174174
);
175175

176176
/// Enable Swift Package Manager as a darwin dependency manager.
177-
const Feature swiftPackageManager = Feature.fullyEnabled(
177+
const Feature swiftPackageManager = Feature(
178178
name: 'support for Swift Package Manager for iOS and macOS',
179179
configSetting: 'enable-swift-package-manager',
180180
environmentOverride: 'FLUTTER_SWIFT_PACKAGE_MANAGER',
181+
master: FeatureChannelSetting(available: true),
182+
beta: FeatureChannelSetting(available: true),
183+
stable: FeatureChannelSetting(available: true),
181184
);
182185

183186
/// Enable migrating iOS and macOS apps to add Swift Package Manager integration.

packages/flutter_tools/test/general.shard/features_test.dart

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -410,12 +410,12 @@ void main() {
410410

411411
group('Swift Package Manager feature', () {
412412
testWithoutContext('availability and default enabled', () {
413-
expect(swiftPackageManager.master.enabledByDefault, isTrue);
414-
expect(swiftPackageManager.master.available, isTrue);
415-
expect(swiftPackageManager.beta.enabledByDefault, isTrue);
416-
expect(swiftPackageManager.beta.available, isTrue);
417-
expect(swiftPackageManager.stable.enabledByDefault, isTrue);
418-
expect(swiftPackageManager.stable.available, isTrue);
413+
expect(swiftPackageManager.master.enabledByDefault, false);
414+
expect(swiftPackageManager.master.available, true);
415+
expect(swiftPackageManager.beta.enabledByDefault, false);
416+
expect(swiftPackageManager.beta.available, true);
417+
expect(swiftPackageManager.stable.enabledByDefault, false);
418+
expect(swiftPackageManager.stable.available, true);
419419
});
420420

421421
testWithoutContext('can be enabled', () {
@@ -427,12 +427,12 @@ void main() {
427427

428428
group('Swift Package Manager app migration feature', () {
429429
testWithoutContext('availability and default enabled', () {
430-
expect(swiftPackageManagerMigration.master.enabledByDefault, isFalse);
431-
expect(swiftPackageManagerMigration.master.available, isTrue);
432-
expect(swiftPackageManagerMigration.beta.enabledByDefault, isFalse);
433-
expect(swiftPackageManagerMigration.beta.available, isTrue);
434-
expect(swiftPackageManagerMigration.stable.enabledByDefault, isFalse);
435-
expect(swiftPackageManagerMigration.stable.available, isTrue);
430+
expect(swiftPackageManagerMigration.master.enabledByDefault, false);
431+
expect(swiftPackageManagerMigration.master.available, true);
432+
expect(swiftPackageManagerMigration.beta.enabledByDefault, false);
433+
expect(swiftPackageManagerMigration.beta.available, true);
434+
expect(swiftPackageManagerMigration.stable.enabledByDefault, false);
435+
expect(swiftPackageManagerMigration.stable.available, true);
436436
});
437437

438438
testWithoutContext('requires Swift Package Manager feature', () {

0 commit comments

Comments
 (0)