Skip to content

Conversation

@xster
Copy link
Member

@xster xster commented Apr 9, 2020

@googlebot googlebot added the cla: yes Contributor has signed the Contributor License Agreement label Apr 9, 2020
@sfshaza2
Copy link
Contributor

sfshaza2 commented Apr 9, 2020

This looks fine to me, but I'm waiting for reviews by the SWEs.

version. In this example, the host app requested v2.10.1 and the Flutter
module plugin requested v2.9.9.

By default, Gradle v5 will [resolve dependency version conflicts](https://docs.gradle.org/current/userguide/dependency_resolution.html#sub:resolution-strategy)
Copy link

Choose a reason for hiding this comment

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

Gradle v6

Copy link
Member Author

Choose a reason for hiding this comment

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

how about gradle v5+? Since not everyone's on 6 and 5 resolves it this way too.

Copy link

Choose a reason for hiding this comment

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

https://docs.gradle.org/current/userguide/dependency_resolution.html refers to v6, which is the current version/

Copy link

@blasten blasten left a comment

Choose a reason for hiding this comment

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

LGTM + minor nit

module plugin requested v2.9.9.

By default, Gradle v5 will [resolve dependency version conflicts](https://docs.gradle.org/current/userguide/dependency_resolution.html#sub:resolution-strategy)
by using the newest version of the library.
Copy link

Choose a reason for hiding this comment

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

by using the newest version of the library

It picks the first dependency that shows up in Graph while traversing. :/

Copy link

Choose a reason for hiding this comment

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

Even they admit that this is bad. "With Maven, this could have unwanted impact on resolved versions.".

Copy link
Member Author

Choose a reason for hiding this comment

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

lol is that right?

https://docs.gradle.org/current/userguide/dependency_resolution.html says "Gradle will consider all requested versions, wherever they appear in the dependency graph. Out of these versions, it will select the highest one."

But it's so random I wouldn't be surprised if the implementation did that too.

Copy link

Choose a reason for hiding this comment

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

I guess even the docs is confusing. It also says:

Apache Maven uses a nearest first strategy.

Maven will take the shortest path to a dependency and use that version. In case there are multiple paths of the same length, the first one wins.

Copy link
Contributor

@sfshaza2 sfshaza2 left a comment

Choose a reason for hiding this comment

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

LGTM

@sfshaza2 sfshaza2 merged commit 1e2e86c into flutter:master Apr 13, 2020

Some plugins require you to make some edits to the Android side of your project.

Taking the [firebase_crashlytics plugin](https://pub.dev/packages/firebase_crashlytics)
Copy link
Member

Choose a reason for hiding this comment

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

"Taking the firebase_crashlytics plugin as an example." is an awkward sentence, maybe "As an example, the firebase_crashlytics plugin integration instructionsl..."

Copy link
Member Author

Choose a reason for hiding this comment

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

took your version

Some plugins require you to make some edits to the Android side of your project.

Taking the [firebase_crashlytics plugin](https://pub.dev/packages/firebase_crashlytics)
as an example. The plugin's integration instructions requires some manual edits
Copy link
Member

Choose a reason for hiding this comment

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

"instructions require manual edits"

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

as an example. The plugin's integration instructions requires some manual edits
to your Android wrapper project's `build.gradle` file.

In the case of a Flutter module, which only has Dart files, perform those
Copy link
Member

Choose a reason for hiding this comment

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

Make these Gradle file edits on the outer, existing Android app rather than in your Flutter module, which only contains dart files.

By default, Gradle v5 will [resolve dependency version conflicts](https://docs.gradle.org/current/userguide/dependency_resolution.html#sub:resolution-strategy)
by using the newest version of the library.

This is generally ok as long as there are no API or implementation breaking
Copy link
Member

Choose a reason for hiding this comment

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

ok->okay

application already depends on the same Android library your Flutter module
does (transitively via a plugin).

For instance, your existing app's Gradle may already have:
Copy link
Member

Choose a reason for hiding this comment

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

@sfshaza2 do you have a preference for "for example" vs "for instance"?

Comment on lines +126 to +128
For Gradle libraries that follow semantic versioning, making sure that your
existing app and your Flutter module plugin use the same major semantic version
will help you avoid compile or runtime errors.
Copy link
Member

Choose a reason for hiding this comment

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

For Gradle libraries that follow semantic versioning, you can generally avoid compilation and runtime errors by using the same major semantic version in your existing app and Flutter module plugin.

Copy link
Member Author

Choose a reason for hiding this comment

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

ok, took your version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Contributor has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants