Skip to content

Conversation

@bartekpacia
Copy link
Member

@bartekpacia bartekpacia commented Dec 6, 2023

This PR adds a deprecation message when Android build is using the legacy "apply script method" way of applying Flutter's Gradle plugins (that is: flutter.gradle and app_plugin_loader.gradle).

See also:

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • All existing and new tests are passing.

@bartekpacia
Copy link
Member Author

bartekpacia commented Dec 6, 2023

The URL currently linked to is temporary. It'll likely be some go/xyz link once the migration gudie (flutter/website#9857) is merged.

@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Dec 6, 2023
@bartekpacia
Copy link
Member Author

bartekpacia commented Dec 6, 2023

This change should very likely be included in Flutter's "at least 1 year or 4 releases, whichever longer" deprecation policy.

cc @reidbaker

not asking for review yet because migration guide PR is not merged yet

@bartekpacia bartekpacia marked this pull request as ready for review December 8, 2023 12:12
@bartekpacia bartekpacia requested a review from reidbaker December 8, 2023 12:12
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@text-exemption-reviewers" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@reidbaker
Copy link
Contributor

@christopherfujino what level of error/warning do you want to see here. I can see us using error because we want folks to know but also I can see someone being annoyed at an error (I am thinking of our own testing infra) that is actually a warning.

These messages pass both the warning and error guidance in our styleguide. https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#only-log-actionable-messages-to-the-console

@reidbaker
Copy link
Contributor

FWIW if you wanted to add a test I believe there are a few integration tests that check for log messages.
I think dev/integration_tests would be a good starting point.

@bartekpacia
Copy link
Member Author

bartekpacia commented Dec 13, 2023

if you wanted to add a test I believe there are a few integration tests that check for log messages.

@reidbaker As much as I'm a fan of testing, I don't think a test is necessary (or even would bring any value) here.

@bartekpacia
Copy link
Member Author

bartekpacia commented Dec 13, 2023

I can see us using error because we want folks to know but also I can see someone being annoyed at an error (I am thinking of our own testing infra) that is actually a warning.

Yeah, I understand, but I haven't found a way for a tool to display a warning (say, yellow text) always, not only when run with --verbose.

Also, I'm happy to volunteer to migrating (as much as necessary amount) to "declarative plugins {} block" way of applying the plugins in the flutter repo, if necessary.

@reidbaker
Copy link
Contributor

if you wanted to add a test I believe there are a few integration tests that check for log messages.

@reidbaker As much as I'm a fan of testing, I don't think a test is necessary (or even would bring any value) here.

The value would come from making sure we dont accidentally stop logging this message. That said I am ok with this landing since the consequence is the same as the current behavior.

@bartekpacia
Copy link
Member Author

Should I get test exemption from Hixie or Stuart Morgan?

@reidbaker
Copy link
Contributor

Yep that is the process.

@matanlurey
Copy link
Contributor

test-exempt: no changes to the app, just a logging message as part of a deprecation.

@bartekpacia bartekpacia added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 13, 2023
@bartekpacia
Copy link
Member Author

Thanks @matanlurey :D

@auto-submit auto-submit bot merged commit 4aef59b into flutter:master Dec 13, 2023
@bartekpacia bartekpacia deleted the chore/deprecate_imperative_plugin_appl branch December 13, 2023 21:10
@hellohuanlin hellohuanlin added the revert Autorevert PR (with "Reason for revert:" comment) label Dec 13, 2023
@auto-submit auto-submit bot removed the revert Autorevert PR (with "Reason for revert:" comment) label Dec 13, 2023
auto-submit bot pushed a commit that referenced this pull request Dec 13, 2023
auto-submit bot added a commit that referenced this pull request Dec 13, 2023
… script method" way" (#140102)

Reverts #139690
Initiated by: hellohuanlin
This change reverts the following previous change:
Original Description:
This PR adds a deprecation message when Android build is using the legacy "apply script method" way of applying Flutter's Gradle plugins (that is: [`flutter.gradle`](https://github.com/flutter/flutter/blob/3.16.0/packages/flutter_tools/gradle/flutter.gradle) and [`app_plugin_loader.gradle`](https://github.com/flutter/flutter/blob/3.16.0/packages/flutter_tools/gradle/app_plugin_loader.gradle)).

See also:
- #121541
  - in particular #121541 (comment)
- #135392
  - and PR that add the migration guide: [#9857](flutter/website#9857)

- I think either `logger.error` or `logger.quiet` must be used, because all other error levels are not shown during `flutter build apk` (and that's what most people use).
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 14, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 14, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 14, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 14, 2023
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Dec 14, 2023
flutter/flutter@11a9cb7...a51e33a

2023-12-14 [email protected] Roll Flutter Engine from 223f4b2465dd to caf33276468b (1 revision) (flutter/flutter#140156)
2023-12-14 [email protected] Roll Packages from b5958e2 to 1151191 (10 revisions) (flutter/flutter#140154)
2023-12-14 [email protected] Roll Flutter Engine from a3f9393f9591 to 223f4b2465dd (1 revision) (flutter/flutter#140151)
2023-12-14 [email protected] Roll Flutter Engine from 913446eca57c to a3f9393f9591 (2 revisions) (flutter/flutter#140144)
2023-12-14 [email protected] Roll Flutter Engine from 923f9e29d4b5 to 913446eca57c (1 revision) (flutter/flutter#140132)
2023-12-14 [email protected] Roll Flutter Engine from 9f7004e3e30e to 923f9e29d4b5 (7 revisions) (flutter/flutter#140130)
2023-12-14 [email protected] Add self back to CODEOWNERS (flutter/flutter#140080)
2023-12-14 [email protected] Adapt wording for required Android SDK for plugins (flutter/flutter#140043)
2023-12-14 [email protected] [reland] Support conditional bundling of assets based on `--flavor` (flutter/flutter#139834)
2023-12-14 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Roll Flutter Engine from 9f7004e3e30e to 45b95f264d63 (1 revision)" (flutter/flutter#140123)
2023-12-14 [email protected] [deps] update Android SDK to 34 (flutter/flutter#138183)
2023-12-14 [email protected] Roll Flutter Engine from 9f7004e3e30e to 45b95f264d63 (1 revision) (flutter/flutter#140108)
2023-12-14 [email protected] Catch `Stopwatch` with static analysis (flutter/flutter#140019)
2023-12-14 [email protected] Overlay supports unconstrained environments (flutter/flutter#139513)
2023-12-14 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 2.22.10 to 3.22.11 (flutter/flutter#140087)
2023-12-14 [email protected] Remove deprecated `ThemeData.selectedRowColor` (flutter/flutter#139080)
2023-12-14 [email protected] Unpin mac_toolchain version (flutter/flutter#139938)
2023-12-14 [email protected] Optimize file transfer when using proxied devices. (flutter/flutter#139968)
2023-12-14 [email protected] Add commonly used parameter names (flutter/flutter#140027)
2023-12-13 [email protected] Roll Flutter Engine from fc3267724e1b to 9f7004e3e30e (4 revisions) (flutter/flutter#140090)
2023-12-13 [email protected] [Windows] Remove header guard from generated key map (flutter/flutter#140082)
2023-12-13 [email protected] Do not use project in do last (flutter/flutter#139325)
2023-12-13 [email protected] Roll pub packages (flutter/flutter#140024)
2023-12-13 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Warn when Gradle plugins are applied using the legacy "apply script method" way" (flutter/flutter#140102)
2023-12-13 [email protected] Swap iOS back button icon in Material app bar (flutter/flutter#134754)
2023-12-13 [email protected] Roll Packages from 80aa46a to b5958e2 (10 revisions) (flutter/flutter#140069)
2023-12-13 [email protected] Roll Flutter Engine from 9039ac78cf03 to fc3267724e1b (26 revisions) (flutter/flutter#140084)
2023-12-13 [email protected] Warn when Gradle plugins are applied using the legacy "apply script method" way (flutter/flutter#139690)
2023-12-13 [email protected] Add self as bundler dependabot reviewer (flutter/flutter#140081)
2023-12-13 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Make tests more resilient to Skia gold failures and refactor flutter_goldens for extensive technical debt removal" (flutter/flutter#140085)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
auto-submit bot pushed a commit that referenced this pull request Dec 19, 2023
…cript method (#140103)

> This PR relands #139690 which was reverted in #140102

This PR adds a deprecation message when Android build is using the legacy "apply script method" way of applying Flutter's Gradle plugins (that is: [`flutter.gradle`](https://github.com/flutter/flutter/blob/3.16.0/packages/flutter_tools/gradle/flutter.gradle) and [`app_plugin_loader.gradle`](https://github.com/flutter/flutter/blob/3.16.0/packages/flutter_tools/gradle/app_plugin_loader.gradle)).

See also:
- #121541
  - in particular #121541 (comment)
- #135392
  - and PR that add the migration guide: [#9857](flutter/website#9857)

- I think either `logger.error` or `logger.quiet` must be used, because all other error levels are not shown during `flutter build apk` (and that's what most people use).
CoderDake pushed a commit to CoderDake/flutter that referenced this pull request Dec 28, 2023
…cript method (flutter#140103)

> This PR relands flutter#139690 which was reverted in flutter#140102

This PR adds a deprecation message when Android build is using the legacy "apply script method" way of applying Flutter's Gradle plugins (that is: [`flutter.gradle`](https://github.com/flutter/flutter/blob/3.16.0/packages/flutter_tools/gradle/flutter.gradle) and [`app_plugin_loader.gradle`](https://github.com/flutter/flutter/blob/3.16.0/packages/flutter_tools/gradle/app_plugin_loader.gradle)).

See also:
- flutter#121541
  - in particular flutter#121541 (comment)
- flutter#135392
  - and PR that add the migration guide: [flutter#9857](flutter/website#9857)

- I think either `logger.error` or `logger.quiet` must be used, because all other error levels are not shown during `flutter build apk` (and that's what most people use).
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 16, 2024
github-merge-queue bot pushed a commit that referenced this pull request Jan 7, 2025
imperative apply has been deprecated since #139690

part of #121541

Doing this will make things easier for us during the conversion of
`flutter.groovy` into Kotlin.
srujzs pushed a commit to srujzs/flutter that referenced this pull request Jan 12, 2025
…#160947)

imperative apply has been deprecated since flutter#139690

part of flutter#121541

Doing this will make things easier for us during the conversion of
`flutter.groovy` into Kotlin.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants