-
Notifications
You must be signed in to change notification settings - Fork 6k
Lint android scenario app #27409
Lint android scenario app #27409
Conversation
| if ((flutter_runtime_mode == "debug" || flutter_runtime_mode == "profile") && | ||
| (is_ios || is_android)) { |
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.
Since linting is now part of this target, make sure we're not unnecessarily building it.
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.
is profile used somewhere? As far as I remember, debug is only used.
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.
It's used for firebase testlab
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.
How much time does linting add to these build configurations?
| ] | ||
| } | ||
|
|
||
| gradle_task("android") { |
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.
nice!
|
|
||
| @Override | ||
| public void finish(int resultCode, Bundle results) { | ||
| public void finish(int resultCode, @Nullable Bundle results) { |
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.
are we getting lint warnings for @Nullable/@NonNullable?
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.
Yes
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.
We should enable these for the embedding too. I suspect there are places where we don't have the right annotations.
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.
Would it be too crazy if we remove flutter.jar and instead link the source 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.
We have a seprate script for linting the embedding at //android_lint. There's a baseline file in there with things we already are failing on. That could be driven down separately.
I think this is a better test if we link in flutter.jar the way regular applications do - not quite sure what you have in mind here though.
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.
This way we don't need https://github.com/flutter/engine/blob/1eb8a34a3975070c42bc69f3981348dfa4f50a2d/tools/android_lint/bin/main.dart, right?
Since the linter is usually called by AGP, I wonder if there are additional benefits that required a more conventional Android project structure
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.
We don't have a normal Gradle project there though.
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.
it still builds with Gradle and AGP right? or is build.gradle never used?
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.
That tool directly invokes lint. It does not use Gradle or agp.
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.
The scenario app itself is a Gradle project, no? I was thinking since it is, it can also lint the embedding source code
blasten
left a comment
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.
LGTM
|
I need to figure out why this is failing CI - it broke something. |
|
The "Linux Android Scenarios" CI failure is not specific to this PR. See #27414 - whenever LUCI runs the test on the API 23 emulator, the test hangs until it is killed by the CI task's timeout. ("Linux Android Scenarios" was previously green only because the test failed to build and the LUCI recipe was ignoring the error code from the script that builds and runs the test). |
|
After the test invokes |
|
Per Dan, we need to move some test to the framework. More context in flutter/flutter#86427. Per Jason, we should land rebase and land this. |
In particular would have caught NewApi violations in #86427
Fixes flutter/flutter#86430