Commit Graph

100 Commits

Author SHA1 Message Date
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
Gray Mackall
39bdff16c1
Remove embedding v1 code in framework (#144726)
Pre work for https://github.com/flutter/engine/pull/51229. Removes a lot of code referencing v1 of the android embedding, though not necessarily all of it (I may have missed some, it is hard to know).

Will hopefully make landing that PR less painful (or maybe painless?)
2024-03-20 20:34:14 +00:00
Christopher Fujino
d550ba54eb
[flutter_tools] toolexit when using plugins with preview device (#136936)
Part of https://github.com/flutter/flutter/issues/130277

Without this, if a user runs an app that has plugins that call method channels with the `preview` device, the app will build successfully, however, they will get a runtime error when their dart code tries to call the method channel that does not exist in the native build (which was pre-built and thus does not include the plugin code).

This change adds a validation when injecting plugins that will tool exit if the device-id is `preview` and their project contains plugins with method channels.
2023-11-07 20:37:19 +00:00
Christopher Fujino
9751fe6449
[flutter_tools] handle ERROR_INVALID_FUNCTION when trying to symlink across drives (#136424)
~~Fixes https://github.com/flutter/flutter/issues/136321~~

edit by @andrewkolos: Fixes https://github.com/flutter/flutter/issues/66224
2023-10-12 17:15:45 +00:00
Tomasz Gucio
99c7e9f088
Add spaces after flow control statements (#126320) 2023-05-15 11:07:30 +02:00
Michael Goderbauer
38630b6bd1
Remove unnecessary null checks in flutter_tool (#118857)
* dart fix --apply

* manual fixes

* fix after merge conflicts

* review
2023-01-23 21:43:08 +00:00
Jenn Magder
eaaacdcba9
Allow iOS and macOS plugins to share darwin directory (#115337) 2023-01-09 10:33:03 -08:00
Anurag Roy
e6f69add99
[flutter_tools] Replace android v2 embedding broken doc link (#107456) 2022-07-12 20:31:07 +00:00
Christopher Fujino
788c8b8ad4
[flutter_tools] tool exit access denied during symlinking (#106213) 2022-06-23 14:44:09 -07:00
Jonah Williams
db829c1e20
[flutter_tools] migrate more unit tests to null safety (#106153) 2022-06-17 21:34:27 -07:00
David Iglesias
1af8cc1183
[tools][web] Make Plugin Registrant file ephemeral. (#102185) 2022-05-11 17:54:11 -07:00
Alexandre Ardhuin
d40ee2149c
remove unnecessary .toString() (#103226) 2022-05-06 16:04:13 -07:00
Phil Quitslund
b5e7fb076c
[flutter_tools] rename local functions with _s (#102688) 2022-04-27 16:19:07 -07:00
Alexandre Ardhuin
07f1c20474
add missing trailing commas in list/set/map literals (#102585) 2022-04-27 09:15:35 +02:00
Jonah Williams
944fcda67f
[flutter_tools] remove UWP tooling (#102174) 2022-04-26 11:19:07 -07:00
stuartmorgan
2df7dca858
Fully support Dart-only mobile and macOS plugins (#96183) 2022-01-13 08:30:22 -08:00
Gary Qian
dd6a11b7aa
Add reason logging to v1 embedding warning message (#94636) 2021-12-06 14:21:58 -08:00
Greg Spencer
52ae102f18
Adds tool warning log level and command line options to fail on warning/error output (#92031) 2021-11-10 16:13:04 -08:00
Jenn Magder
9e88fe328e
Remove globals_null_migrated.dart, move into globals.dart (#92861) 2021-11-01 17:18:03 -07:00
Chris Yang
42eb903200
[flutter_tools] iOS: display name defaults to the Title Case of flutter project name. (#91529) 2021-10-20 10:33:02 -07:00
Ian Hickson
7b01346c5c
Enable no_default_cases lint (#91530) 2021-10-11 10:23:04 -07:00
Ian Hickson
61a0add286
Enable avoid_redundant_argument_values lint (#91409) (#91462) 2021-10-08 09:25:14 -07:00
Zachary Anderson
b9d2177da0
Revert "Enable avoid_redundant_argument_values lint (#91409)" (#91461)
This reverts commit 5fd259be24.
2021-10-07 21:11:07 -07:00
Ian Hickson
5fd259be24
Enable avoid_redundant_argument_values lint (#91409) 2021-10-07 20:13:02 -07:00
stuartmorgan
23cea26715
Add dartPluginClass support for Android and iOS (#87991) 2021-10-01 16:03:04 -07:00
Emmanuel Garcia
0a8c03dc8a
Show warning when an app or plugin uses the V1 Android embedding (#86750) 2021-07-21 12:51:43 -07:00
Ahmed Ashour
a3dc90c4f5
Add space before curly parentheses. (#85306) 2021-07-01 13:51:05 -07:00
Hattomo (TomohiroHattori)
08a70e7ac8
Enable avoid_escaping_inner_quotes lint (#81153) 2021-05-19 09:54:02 -07:00
Alexandre Ardhuin
c03e7488b4
remove noop primitive operations (#82297) 2021-05-12 00:04:02 -07:00
Jonah Williams
8041a2e5d5
[flutter_tools] remove all mocks from plugins_test (#81485) 2021-04-29 22:40:44 -07:00
Ian Hickson
6beafa7b16
Apply style guide regarding createTempSync pattern (#81090) 2021-04-27 14:59:03 -07:00
Emmanuel Garcia
b0a63c4ffe
Reland the Dart plugin registry (#79669) 2021-04-23 15:34:04 -07:00
Jenn Magder
a99fba01f1
Move FakeOperatingSystemUtils from context.dart to fakes.dart (#80916) 2021-04-22 10:44:02 -07:00
Jenn Magder
d40cc5af8f
Migrate flutter_tool plugins.dart to null safety (#80304) 2021-04-13 13:52:58 -07:00
Alan Trope
bd96a8f9d5
Catch errors during android plugin registration (#78964) 2021-04-09 09:44:03 -07:00
Sam Rawlins
68492c5b69
Remove "unnecessary" imports. (#78664) 2021-04-06 11:19:02 -07:00
Jenn Magder
8ddc27e607
Split globals.dart into null sound and unsound libraries (#79016) 2021-03-31 16:55:20 -07:00
Zachary Anderson
5efc7169eb
Reverts "Implement dartPluginClass support for plugins #74469" (#78623)
* Revert "Enable dart_plugin_registry_test (#76645)"

This reverts commit 109e0bb9f5.

* Revert "Apply changes caused by https://github.com/flutter/flutter/pull/76662 (#77093)"

This reverts commit cdca6485f0.

* Revert "Disable clang format in the plugin registrants (#76662)"

This reverts commit dadbd47d09.

* Revert "Disable warnings for the dart plugin registrant (#76561)"

This reverts commit 098ece522d.

* Revert "Remove dart_plugin_registry_test timeouts (#76838)"

This reverts commit 1610a27476.

* Revert "Implement dartPluginClass support for plugins (#74469)"

This reverts commit b7d4806243.

Kick.
2021-03-23 14:28:11 -07:00
Michael Goderbauer
197b440e96
Migrate out custom ignore syntax to flutter_ignore (#78497) 2021-03-19 15:33:05 -07:00
Jenn Magder
75da995fbc
MockOperatingSystemUtils -> FakeOperatingSystemUtils (#77988) 2021-03-15 11:38:03 -07:00
Jonah Williams
721702717d
[flutter_tools] replace MockFlutterVersion usage with fake where possible, move from context (#77390) 2021-03-05 14:04:03 -08:00
Jonah Williams
2951363dc8
[flutter_tools] switch FakeCache to cache.test and NoopUsage to TestUsage (#76802) 2021-02-26 11:13:32 -08:00
Emmanuel Garcia
098ece522d
Disable warnings for the dart plugin registrant (#76561) 2021-02-23 11:45:33 -08:00
Emmanuel Garcia
b7d4806243
Implement dartPluginClass support for plugins (#74469) 2021-02-19 09:22:45 -08:00
Jonah Williams
bad5df55cb
[flutter_tools] remove MockFeatureFlags (#75259) 2021-02-02 12:10:30 -08:00
Jonah Williams
e53c48968f
[flutter_tools] remove mock SystemClock (#74994) 2021-01-29 14:28:08 -08:00
Jonah Williams
74bd7b6f6d
[flutter_tools] opt all flutter tool libraries and tests out of null safety. (#74832)
* opt out the flutter tool

* oops EOF

* fix import

* Update tool_backend.dart

* Update daemon_client.dart

* fix more
2021-01-27 15:17:53 -08:00
Claire Davis
546b521f33
[flutter_tools] Sort plugins alphabetically when refreshed (#73803) 2021-01-13 09:41:16 -08:00
Alexandre Ardhuin
17cdf5559d
enable unnecessary_string_escapes and use_raw_strings (#68302) (#69025) 2020-10-26 12:42:05 -07:00
Zachary Anderson
cbcd1321ed
Revert "enable unnecessary_string_escapes and use_raw_strings (#68302)" (#68714)
This reverts commit ae06c19a37.
2020-10-21 08:16:13 -07:00