-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
Conversation
packages/flutter_tools/gradle/src/main/kotlin/FlutterPluginConstants.kt
Outdated
Show resolved
Hide resolved
* 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, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
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. |
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. |
FlutterTask
from groovy to kotlinBaseFlutterTask
a bit, to follow a paradigm that methods onBaseFlutterTask
andFlutterTask
will contain no logic, and instead be set equal to a method with the same name inBaseFlutterTaskHelper
andFlutterTaskHelper
respectively, and that both of those helpers will be stateless. This allows us to somewhat get around the fact that you cannot create aTask
instance in testing, because testing the logic of the task is the same as testing the logic of the helper.FlutterPluginConstants
object to hold the constants fromFlutterPlugin
. I think ideally this will be collapsed back in toFlutterPlugin
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.