flutter/packages/flutter_tools/test/commands.shard/hermetic
Victoria Ashworth 6d19fa3bfa
Add Swift Package Manager as new opt-in feature for iOS and macOS (#146256)
This PR adds initial support for Swift Package Manager (SPM). Users must opt in. Only compatible with Xcode 15+.

Fixes https://github.com/flutter/flutter/issues/146369.

## Included Features

This PR includes the following features:
* Enabling SPM via config 
`flutter config --enable-swift-package-manager`
* Disabling SPM via config (will disable for all projects) 
`flutter config --no-enable-swift-package-manager`
* Disabling SPM via pubspec.yaml (will disable for the specific project)
```
flutter:
  disable-swift-package-manager: true
```
* Migrating existing apps to add SPM integration if using a Flutter plugin with a Package.swift
  * Generates a Swift Package (named `FlutterGeneratedPluginSwiftPackage`) that handles Flutter SPM-compatible plugin dependencies. Generated package is added to the Xcode project.
* Error parsing of common errors that may occur due to using CocoaPods and Swift Package Manager together
* Tool will print warnings when using all Swift Package plugins and encourage you to remove CocoaPods

This PR also converts `integration_test` and `integration_test_macos` plugins to be both Swift Packages and CocoaPod Pods.

## How it Works
The Flutter CLI will generate a Swift Package called `FlutterGeneratedPluginSwiftPackage`, which will have local dependencies on all Swift Package compatible Flutter plugins.  

The `FlutterGeneratedPluginSwiftPackage` package will be added to the Xcode project via altering of the `project.pbxproj`. 

In addition, a "Pre-action" script will be added via altering of the `Runner.xcscheme`. This script will invoke the flutter tool to copy the Flutter/FlutterMacOS framework to the `BUILT_PRODUCTS_DIR` directory before the build starts. This is needed because plugins need to be linked to the Flutter framework and fortunately Swift Package Manager automatically uses `BUILT_PRODUCTS_DIR` as a framework search path.

CocoaPods will continue to run and be used to support non-Swift Package compatible Flutter plugins.

## Not Included Features

It does not include the following (will be added in future PRs):
* Create plugin template
* Create app template
* Add-to-App integration
2024-04-18 21:12:36 +00:00
..
analyze_continuously_test.dart Enable private field promotion for flutter_tools (#134474) 2023-09-12 20:20:04 +00:00
analyze_suggestion_test.dart Fix formatting (#137613) 2023-10-31 13:27:26 +00:00
analyze_test.dart Make --flutter-repo analyze whole repo (#127990) 2023-06-02 17:17:54 +00:00
android_analyze_test.dart Improves output file path logic in Android analyze (#136981) 2023-11-16 22:59:02 +00:00
assemble_test.dart Migrate command usage values (#139383) 2023-12-07 16:12:03 +00:00
attach_test.dart Support mdns when attaching to proxied devices. (#146021) 2024-04-09 20:00:21 +00:00
build_aar_test.dart provide command to FakeCommand::onRun (#142206) 2024-01-25 07:51:25 +00:00
build_darwin_framework_test.dart Fix embedding FlutterMacOS.framework for macOS add2app via cocoapods (#144248) 2024-03-05 21:59:49 +00:00
build_ios_test.dart Reland #128236 "Improve build output for all platforms" (#145495) 2024-03-23 12:05:21 +00:00
build_ipa_test.dart Reland #128236 "Improve build output for all platforms" (#145495) 2024-03-23 12:05:21 +00:00
build_linux_test.dart Reland #128236 "Improve build output for all platforms" (#145495) 2024-03-23 12:05:21 +00:00
build_macos_test.dart Reland #128236 "Improve build output for all platforms" (#145495) 2024-03-23 12:05:21 +00:00
build_test.dart Flutter preview device (#135639) 2023-10-18 00:27:54 +00:00
build_web_test.dart Reland #128236 "Improve build output for all platforms" (#145495) 2024-03-23 12:05:21 +00:00
build_windows_test.dart Reland #128236 "Improve build output for all platforms" (#145495) 2024-03-23 12:05:21 +00:00
clean_test.dart Add Swift Package Manager as new opt-in feature for iOS and macOS (#146256) 2024-04-18 21:12:36 +00:00
config_test.dart [Reland] Migration for the sendTiming events for package:unified_analytics (#139299) 2023-12-04 21:39:18 +00:00
create_usage_test.dart [Android] Add Java/AGP/Gradle incompatibility warning to flutter create (#131444) 2023-09-20 16:01:04 +00:00
custom_devices_test.dart Remove outdated ignores from tool (#140467) 2023-12-20 22:14:32 +00:00
daemon_test.dart Add a --print-dtd flag to print the DTD address served by DevTools server (#144272) 2024-03-25 13:04:18 -07:00
devices_test.dart Support disabling animations in the CLI (#132239) 2023-08-23 03:35:22 +00:00
doctor_test.dart Remove outdated ignores from tool (#140467) 2023-12-20 22:14:32 +00:00
downgrade_test.dart Give channel descriptions in flutter channel, use branch instead of upstream for channel name (#126936) 2023-05-23 19:59:20 +00:00
drive_test.dart Upload DerivedData logs in CI (#142643) 2024-02-01 21:31:28 +00:00
flutter_web_platform_test.dart flutter test --wasm support (#145347) 2024-03-21 20:08:07 +00:00
generate_localizations_test.dart Enable private field promotion for flutter_tools (#134474) 2023-09-12 20:20:04 +00:00
http_host_validator_test.dart Improve network resources doctor check (#120417) 2023-02-15 00:02:09 +00:00
ide_config_test.dart Null safety migration of packages/flutter_tools/test/commands.shard/hermetic, part 2/3 (#110708) 2022-09-06 10:39:18 -07:00
install_test.dart Remove outdated ignores from tool (#140467) 2023-12-20 22:14:32 +00:00
ios_analyze_test.dart Makes scheme and target optional parameter when getting universal lin… (#134571) 2023-09-15 21:01:05 +00:00
logs_test.dart [flutter_tools] Fix bad state future already completed in flutter logs (#138517) 2023-11-23 19:56:14 +00:00
precache_test.dart Null safety migration of packages/flutter_tools/test/commands.shard/hermetic, part 3/3 (#110709) 2022-09-06 10:22:40 -07:00
proxied_devices_test.dart Update proxied devices to handle connection interface and diagnostics. (#145061) 2024-03-13 22:24:25 +00:00
proxy_validator_test.dart add missing trailing commas in list/set/map literals (#102585) 2022-04-27 09:15:35 +02:00
pub_test.dart Remove embedding v1 code in framework (#144726) 2024-03-20 20:34:14 +00:00
run_test.dart Support flutter run --wasm and flutter drive --wasm. (#146231) 2024-04-12 19:27:26 +00:00
screenshot_command_test.dart Enable flutter screenshot outside Flutter project directory (#138160) 2023-11-17 01:08:13 +00:00
shell_completion_test.dart Null safety migration of packages/flutter_tools/test/commands.shard/hermetic, part 3/3 (#110709) 2022-09-06 10:22:40 -07:00
symbolize_test.dart Prepare for utf8.encode() to return more precise Uint8List type (#129769) 2023-06-29 22:44:57 +02:00
test_test.dart Support flutter run --wasm and flutter drive --wasm. (#146231) 2024-04-12 19:27:26 +00:00
update_packages_test.dart Copy the flutter version JSON file into the simulated Flutter SDK used by update_packages (#143035) 2024-02-06 20:00:08 -08:00
upgrade_test.dart Reland: Update link branches to main (#146882) 2024-04-17 13:16:33 +00:00