-
Notifications
You must be signed in to change notification settings - Fork 29.7k
reads min/target sdk versions from localproperties #95684
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
Conversation
|
How are the values of |
|
How are the values of `flutter.minSdkVersion` and `flutter.targetSdkVersion` initialized at the moment?
Hello @meysammahfouzi, iirc they are hard coded at flutter.gradle file.
|
|
@brunotacca this has merge conflicts with upstream, can you rebase or merge in master to resolve before this is reviewed? |
Thank you for notifying me. |
|
@camsim99 can you (or someone else on the android team) take a look at this PR? |
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 it something to warn about if the developer doesn't specify it in local.properties? I suppose adding this warning could help with Issue #95514, though. Is that your reasoning?
Same comment for flutterTargetSdkVersion.
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.
Exactly that, it could prevent similar issues in the future. Although, since now there is mention of the local.properties on the flutter website docs, I don't know if it's that necessary anymore.
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.
Oh gotcha! Could we possibly move the warning to flutter.gradle and only show it when not defining it will be a problem, i.e. when the minSdkVersion of a dependency is higher than that of the flutter project?
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.
Certainly, I gonna need a little bit of time to understand how flutter.gradle works but I am on it. Let me get this straight, ideally, what would be the conditions to trigger the custom warning about local.properties?
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 seems like if the minSdkVersion of a dependency is greater than that of the mindSdkVersion defined in flutter.gradle, we show the warning so that the person knows how to fix the error that will appear. You can even add a link to your update on the website to the warning for context!
It should be similar to the way we compare the compileSdkVersions of the project and its plugin dependencies right now (see here), but let me know if I can help!
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.
Thank you so much, that should be more than enough for me to get started. I will let you know if I get stuck, thanks!!
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.
@camsim99 Updated the PR description, images. I changed flutter.gradle and also gradle_errors.dart.
Thank you for reviewing.
camsim99
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! Just need to get the tests passing :)
|
To get customer_testing to pass, you will need to rebase (not merge) upstream master. |
…avoid unnecessary layer tree walks (#98219)
* Refactor TextSelectionOverlay * fix test * remove print * fix more tests * update * added tests * fix comments * fmt * fix test * addressing comment * remove dispose * remove new line
|
@christopherfujino It seems that I did something wrong trying to rebase... Should I close this and make another PR? |
That works if you are not able to resolve the bad rebase. |
|
@christopherfujino #98450 I think I did it correctly this time, sorry for the inconvenience. |
This PR changes the
build.gradlefiles to read theflutter.minSdkVersionandflutter.targetSdkVersionfrom the generated local.properties, and if not found, keep the default one (which is set at flutter.gradle)It changes all
build.gradlefiles from examples/* and the integration_test/example.It doesn't change
build.gradlefiles from dev projects at dev/* but they can be changed too upon further request.It changes both java and kotlin
build.gradletemplates.It changes the default app test to expect the new strings on
build.gradle.It doesn't apply the same concept to
flutter.compileSdkVersion, so having it onlocal.propertiesdoesn't change the value set atflutter.gradle, this can also be added upon further request.This PR also changes
flutter.gradleto detect and warn the developer with alogger.quietmessage about mismatches with plugins API level. If a mismatch is found, it also checks if the variablesflutter.minSdkVersionandflutter.targetSdkVersionwere set atlocal.propertiesIt also changes the
gradle_errors.dartto update the box message about how to fix the API level error, while adding a reference to the docs. The test was also updated.Images:
[Before] New project with a dependency requiring higher sdk version.
[After] New project with a dependency requiring higher sdk version.
[After] New project with the variables INcorrectly set at local.properties.
[After] New project with the variables correctly set at local.properties.
It closes #95533
Partially solves #95485 (Android part)
Could be a solution to #95514
Extra - Not related: at 0440790 I fixed the command required to export the
FLUTTER_ROOTvariable in order to run tests.