flutter/packages/flutter_tools/test/src
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
..
android_common.dart Improves output file path logic in Android analyze (#136981) 2023-11-16 22:59:02 +00:00
common.dart Add none language strings to code blocks. (#146154) 2024-04-02 16:42:25 -07:00
context.dart Clean up lint ignores (#144229) 2024-02-27 23:21:03 +00:00
custom_devices_common.dart Remove dead code in tools tests (#104567) 2022-05-25 12:48:17 -07:00
fake_devices.dart Update proxied devices to handle connection interface and diagnostics. (#145061) 2024-03-13 22:24:25 +00:00
fake_http_client.dart Implementing switch expressions in flutter_tools/ (#145632) 2024-03-29 22:31:19 +00:00
fake_process_manager.dart provide command to FakeCommand::onRun (#142206) 2024-01-25 07:51:25 +00:00
fake_vm_services.dart [flutter_tools] Catch rpc error in render frame with raster stats (#144190) 2024-02-28 18:54:18 +00:00
fakes.dart Add Swift Package Manager as new opt-in feature for iOS and macOS (#146256) 2024-04-18 21:12:36 +00:00
io.dart Implementing null-aware operators throughout the repository (#143804) 2024-02-23 19:02:22 +00:00
logging_logger.dart [flutter_tools] Make flutter test -v print timing of different phases (#108864) 2022-08-18 16:26:56 +00:00
pubspec_schema.dart FFI plugins (#96225) 2022-01-26 23:44:45 +01:00
test_build_system.dart Enable private field promotion for flutter_tools (#134474) 2023-09-12 20:20:04 +00:00
test_flutter_command_runner.dart Remove uses of deprecated test_api imports (#124732) 2023-04-20 20:55:28 +00:00
test_wrapper.dart Migrate android_console to null safety (#78923) 2021-03-24 15:18:00 -07:00
testbed.dart Enable private field promotion for flutter_tools (#134474) 2023-09-12 20:20:04 +00:00
throwing_pub.dart reduce pub output from flutter create (#118285) 2023-01-12 21:42:02 +00:00