这是indexloc提供的服务,不要输入任何密码
Skip to content

Clean up null assumptions for Gradle classes #83443

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

Merged
merged 1 commit into from
May 28, 2021

Conversation

jmagman
Copy link
Member

@jmagman jmagman commented May 26, 2021

I started migrating project.dart and all its dependencies, and the diff was huge.
Pull out the Gradle class cleanup parts that can be done without actually migrating to null safety.

Part of #71511

@jmagman jmagman self-assigned this May 26, 2021
@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label May 26, 2021
@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 Hixie on the #hackers channel in Chat.

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.

@google-cla google-cla bot added the cla: yes label May 26, 2021
@jmagman jmagman force-pushed the android-prep-null branch from 7235bd0 to d28fffe Compare May 26, 2021 21:44
@@ -190,7 +190,7 @@ class AndroidGradleBuilder implements AndroidBuilder {
@required FlutterProject project,
@required Set<AndroidBuildInfo> androidBuildInfo,
@required String target,
@required String outputDirectoryPath,
String outputDirectoryPath,
Copy link
Member Author

Choose a reason for hiding this comment

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

Null outputDirectoryPath defaults to project.android.buildDirectory on line 197.

@@ -806,14 +807,13 @@ class AndroidGradleBuilder implements AndroidBuilder {
/// Prints how to consume the AAR from a host app.
void printHowToConsumeAar({
@required Set<String> buildModes,
@required String androidPackage,
String androidPackage = 'unknown',
Copy link
Member Author

Choose a reason for hiding this comment

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

It's possible to pass a nullable androidPackage here. Since it's just used for informational printing, default to "unknown".

Comment on lines +32 to +35
@required String line,
@required FlutterProject project,
@required bool usesAndroidX,
@required bool shouldBuildPluginAsAar,
Copy link
Member Author

Choose a reason for hiding this comment

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

These are always passed in and assumed to be nonnull.

@jmagman jmagman requested a review from jonahwilliams May 26, 2021 22:19
Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM

@fluttergithubbot fluttergithubbot merged commit 6d03cb6 into flutter:master May 28, 2021
@jmagman jmagman deleted the android-prep-null branch June 1, 2021 19:58
@jmagman jmagman added the a: null-safety Support for Dart's null safety feature label Aug 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: null-safety Support for Dart's null safety feature tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants