Skip to content
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

Port FlutterTask from Groovy to Kotlin #165244

Merged
merged 15 commits into from
Mar 18, 2025

Conversation

gmackall
Copy link
Member

@gmackall gmackall commented Mar 15, 2025

  1. Ports FlutterTask from groovy to kotlin
  2. Refactors BaseFlutterTask a bit, to follow a paradigm that methods on BaseFlutterTask and FlutterTask will contain no logic, and instead be set equal to a method with the same name in BaseFlutterTaskHelper and FlutterTaskHelper respectively, and that both of those helpers will be stateless. This allows us to somewhat get around the fact that you cannot create a Task instance in testing, because testing the logic of the task is the same as testing the logic of the helper.
  3. Also creates a FlutterPluginConstants object to hold the constants from FlutterPlugin. I think ideally this will be collapsed back in to FlutterPlugin when the conversion is completed, but it needs to be moved for now so it can be referenced in Kotlin code (this pr needs it).

Fixes #162112

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions bot added platform-android Android applications specifically tool Affects the "flutter" command-line tool. See also t: labels. labels Mar 15, 2025
@gmackall gmackall marked this pull request as ready for review March 18, 2025 16:49
@gmackall gmackall requested a review from a team March 18, 2025 16:49
@reidbaker reidbaker requested a review from jesswrd March 18, 2025 17:55
* Base implementation of a Gradle task. Gradle tasks can not be instantiated for testing,
* so this class delegates all logic to [BaseFlutterTaskHelper].
*
* IMPORTANT: Do not add logic to the methods in this class directly,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ktdoc nit: /** is used for comments shown to callers of this class. // (or /* */) Is normally used for maintainers or people reading the implementation.

I don't think it needs to be changed in this pr but wanted to use this opportunity to share the difference.

javadoc
https://engdoc.corp.google.com/eng/doc/devguide/java/style/index.md?cl=head#s7-javadoc

vs
Implementation comments
https://engdoc.corp.google.com/eng/doc/devguide/java/style/index.md?cl=head#s4.8.6-comments

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not know this, thanks. Will change

@gmackall gmackall added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 18, 2025
Copy link
Contributor

auto-submit bot commented Mar 18, 2025

autosubmit label was removed for flutter/flutter/165244, because - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Mar 18, 2025
@gmackall gmackall added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 18, 2025
Copy link
Contributor

auto-submit bot commented Mar 18, 2025

autosubmit label was removed for flutter/flutter/165244, because - The status or check suite Mac tool_integration_tests_2_5 has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Mar 18, 2025
@gmackall gmackall added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 18, 2025
@gmackall gmackall added autosubmit Merge PR when tree becomes green via auto submit App and removed autosubmit Merge PR when tree becomes green via auto submit App labels Mar 18, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Mar 18, 2025
Merged via the queue into flutter:master with commit bd16603 Mar 18, 2025
136 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform-android Android applications specifically tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FGP Kotlin conversion] Convert FlutterTask
3 participants