Skip to content

[flutter_tools] Migrate platforms away from .flutter-plugins #48918

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
franciscojma86 opened this issue Jan 15, 2020 · 11 comments
Open

[flutter_tools] Migrate platforms away from .flutter-plugins #48918

franciscojma86 opened this issue Jan 15, 2020 · 11 comments
Assignees
Labels
c: API break Backwards-incompatible API changes p: waiting for stable update flutter/packages issues that can't be fixed until functionality reaches the stable Flutter channel P2 Important issues not at the top of the work list team-tool Owned by Flutter Tool team tool Affects the "flutter" command-line tool. See also t: labels. triaged-tool Triaged by Flutter Tool team

Comments

@franciscojma86
Copy link
Contributor

#48614 moves the plugins list to .flutter-plugins-dependencies. .flutter-plugins will be kept for a whilee to avoid breaking existing apps, but should be removed after the migration is complete

@dnfield dnfield added tool Affects the "flutter" command-line tool. See also t: labels. c: API break Backwards-incompatible API changes labels Jan 16, 2020
@jmagman
Copy link
Member

jmagman commented Jan 18, 2020

Is this a duplicate of #39657?

@jmagman
Copy link
Member

jmagman commented Jan 18, 2020

Oh never mind this is the cleanup step.

@dnfield
Copy link
Contributor

dnfield commented Dec 8, 2020

Is the migration on this complete?

@jmagman
Copy link
Member

jmagman commented Dec 8, 2020

It's still being parsed:

File pluginsFile = new File(project.projectDir.parentFile.parentFile, '.flutter-plugins')
plugin_pods = parse_KV_file('../.flutter-plugins')

final File flutterPluginFile = flutterProject.flutterPluginsFile;

final int numberOfPlugins = (rootProject.flutterPluginsFile.readAsLinesSync()).length;

@flutter-triage-bot flutter-triage-bot bot added the team-tool Owned by Flutter Tool team label Jul 8, 2023
@christopherfujino christopherfujino added the P3 Issues that are less important to the Flutter project label Aug 1, 2023
@christopherfujino
Copy link
Contributor

@Gustl22
Copy link
Contributor

Gustl22 commented Oct 25, 2023

There may are projects, which were created with an old settings.gradle file, which references the .flutter-plugins file directly. This also may needs a test to not break the user experience somehow or write a proper migration / error message to upgrade it.
For reference:
#137115 (comment)
#98048 (comment)

Edit: it also states to remove dependencyGraph after migration, which is still used in flutter.groovy and I wonder how multiple transitive dependencies are handled then...or they just directly are stated in the plugins section then and the handling can just be safely removed (?)

auto-submit bot pushed a commit that referenced this issue Dec 21, 2023
Relands #97823

When the tool migrated to `.flutter-plugins-dependencies`, the Gradle plugin was never changed.
Until now, the plugin had the heuristic that a plugin with a `android/build.gradle` file supported the Android platform.

Also applies schema of `getPluginDependencies` to `getPluginList` which uses a `List` of Object instead of `Properties`.

Fixes #97729
Cause of the error: https://github.com/flutter/flutter/blob/5f105a6ca7a5ac7b8bc9b241f4c2d86f4188cf5c/packages/flutter_tools/gradle/flutter.gradle#L421C25-L421C25

Fixes #98048
The deprecated line `include ":$name"` in `settings.gradle` (pluginEach) in old projects causes the `project.rootProject.findProject` to also find the plugin "project", so it is not failing on the `afterEvaluate` method. But the plugin shouldn't be included in the first place as it fails with `Could not find method implementation() for arguments` error in special cases.

Related to #48918, see [_writeFlutterPluginsListLegacy](https://github.com/flutter/flutter/blob/27bc1cf61a5b54bf655062be63050123abb617e4/packages/flutter_tools/lib/src/flutter_plugins.dart#L248).

Co-authored-by: Emmanuel Garcia <[email protected]>
@Gustl22
Copy link
Contributor

Gustl22 commented Dec 21, 2023

Looks like we're still parsing this in 2023

This is now solved in #137115

I think #54566 is obsolete due to #135392 and we can remove all the .flutter-plugins related stuff (generation and tests) after the deprecation period.

CoderDake pushed a commit to CoderDake/flutter that referenced this issue Dec 28, 2023
Relands flutter#97823

When the tool migrated to `.flutter-plugins-dependencies`, the Gradle plugin was never changed.
Until now, the plugin had the heuristic that a plugin with a `android/build.gradle` file supported the Android platform.

Also applies schema of `getPluginDependencies` to `getPluginList` which uses a `List` of Object instead of `Properties`.

Fixes flutter#97729
Cause of the error: https://github.com/flutter/flutter/blob/5f105a6ca7a5ac7b8bc9b241f4c2d86f4188cf5c/packages/flutter_tools/gradle/flutter.gradle#L421C25-L421C25

Fixes flutter#98048
The deprecated line `include ":$name"` in `settings.gradle` (pluginEach) in old projects causes the `project.rootProject.findProject` to also find the plugin "project", so it is not failing on the `afterEvaluate` method. But the plugin shouldn't be included in the first place as it fails with `Could not find method implementation() for arguments` error in special cases.

Related to flutter#48918, see [_writeFlutterPluginsListLegacy](https://github.com/flutter/flutter/blob/27bc1cf61a5b54bf655062be63050123abb617e4/packages/flutter_tools/lib/src/flutter_plugins.dart#L248).

Co-authored-by: Emmanuel Garcia <[email protected]>
@bartekpacia
Copy link
Member

bartekpacia commented Jan 9, 2024

@Gustl22 What's the deprecation period in this case? Will it start counting when the next Flutter stable is released and the imperative apply plugin way of applying Flutter's Gradle plugin becomes deprecated (as described in this migration guide)?

@Gustl22
Copy link
Contributor

Gustl22 commented Jan 9, 2024

@bartekpacia I'm not that familiar with the process. But it then has the same cycle as the imperative apply plugin deprecation. I think the counting starts when this is released to stable then.

@matanlurey matanlurey added P2 Important issues not at the top of the work list and removed P3 Issues that are less important to the Flutter project labels Oct 22, 2024
@matanlurey matanlurey self-assigned this Oct 22, 2024
auto-submit bot pushed a commit that referenced this issue Oct 24, 2024
…157388)

Work towards #48918.

This file was soft deprecated in _2020_, but the code was never removed. This warning message will serve as a warning and we'll rip out support for `flutter-plugins` after the _next_ stable release (i.e. after the mid-November branch cut).
matanlurey added a commit to flutter/website that referenced this issue Oct 24, 2024
Work towards flutter/flutter#48918.

---------

Co-authored-by: Shams Zakhour (ignore Sfshaza) <[email protected]>
auto-submit bot added a commit that referenced this issue Oct 24, 2024
…` file. (#157388)" (#157541)

Reverts: #157388
Initiated by: matanlurey
Reason for reverting: We have `--fatal-warnings` on postsubmit and this breaks the tree.
Original PR Author: matanlurey

Reviewed By: {reidbaker}

This change reverts the following previous change:
Work towards #48918.

This file was soft deprecated in _2020_, but the code was never removed. This warning message will serve as a warning and we'll rip out support for `flutter-plugins` after the _next_ stable release (i.e. after the mid-November branch cut).
auto-submit bot added a commit that referenced this issue Oct 24, 2024
…r-plugins` file. (#157388)" (#157541)" (#157549)

Reverts: #157541
Initiated by: matanlurey
Reason for reverting: Was _not_ the cause of failure, see #157542.
Original PR Author: auto-submit[bot]

Reviewed By: {fluttergithubbot}

This change reverts the following previous change:
Reverts: #157388
Initiated by: matanlurey
Reason for reverting: We have `--fatal-warnings` on postsubmit and this breaks the tree.
Original PR Author: matanlurey

Reviewed By: {reidbaker}

This change reverts the following previous change:
Work towards #48918.

This file was soft deprecated in _2020_, but the code was never removed. This warning message will serve as a warning and we'll rip out support for `flutter-plugins` after the _next_ stable release (i.e. after the mid-November branch cut).
auto-submit bot pushed a commit that referenced this issue Oct 24, 2024
…t`. (#157527)

Work towards #48918.

Workaround for #157391 (see #157393 (comment)).

I'll run all post-submit tasks as well on this PR using `test: all`.
M97Chahboun pushed a commit to M97Chahboun/flutter that referenced this issue Oct 30, 2024
…lutter#157388)

Work towards flutter#48918.

This file was soft deprecated in _2020_, but the code was never removed. This warning message will serve as a warning and we'll rip out support for `flutter-plugins` after the _next_ stable release (i.e. after the mid-November branch cut).
@matanlurey
Copy link
Contributor

As of the latest master, this is true behind the flag flutter config explicit-package-dependencies.

@matanlurey
Copy link
Contributor

matanlurey commented Feb 22, 2025

As of the latest master (#160289), this is true by default.

After the next stable release, the ability to opt-out will be removed, and the feature can be removed.

@matanlurey matanlurey added the p: waiting for stable update flutter/packages issues that can't be fixed until functionality reaches the stable Flutter channel label Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: API break Backwards-incompatible API changes p: waiting for stable update flutter/packages issues that can't be fixed until functionality reaches the stable Flutter channel P2 Important issues not at the top of the work list team-tool Owned by Flutter Tool team tool Affects the "flutter" command-line tool. See also t: labels. triaged-tool Triaged by Flutter Tool team
Projects
None yet
Development

No branches or pull requests

7 participants