flutter/packages/flutter_tools/bin
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
..
analysis_options.yaml Enable avoid_print lint. (#91444) 2021-10-07 16:48:04 -07:00
flutter_tools.dart Reland "Null safety migration of packages/flutter_tools/bin" (#111756) 2022-09-16 12:39:55 -07:00
fuchsia_asset_builder.dart consolidate AssetBundle::entries and AssetBundle::entryKinds into a new type, AssetBundleEntry (#142029) 2024-01-23 22:00:46 +00:00
fuchsia_tester.dart Reland "Move native assets to isolated/ directory" (#143055) 2024-02-08 17:49:48 +00:00
macos_assemble.sh Add Swift Package Manager as new opt-in feature for iOS and macOS (#146256) 2024-04-18 21:12:36 +00:00
podhelper.rb Add Swift Package Manager as new opt-in feature for iOS and macOS (#146256) 2024-04-18 21:12:36 +00:00
tool_backend.bat License update (#45373) 2019-11-27 15:04:02 -08:00
tool_backend.dart Enable native compilation for windows-arm64 (#141930) 2024-01-26 00:08:20 +00:00
tool_backend.sh License update (#45373) 2019-11-27 15:04:02 -08:00
xcode_backend.dart Add Swift Package Manager as new opt-in feature for iOS and macOS (#146256) 2024-04-18 21:12:36 +00:00
xcode_backend.sh [flutter_tools] Port xcode backend to dart (#86753) 2021-07-27 14:39:05 -07:00
xcode_debug.js Wait for CONFIGURATION_BUILD_DIR to update when debugging with Xcode (#135444) 2023-09-26 17:48:19 +00:00