Skip to content
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

reads min/target sdk versions from localproperties #98450

Merged
merged 5 commits into from
Feb 24, 2022
Merged

reads min/target sdk versions from localproperties #98450

merged 5 commits into from
Feb 24, 2022

Conversation

brunotacca
Copy link
Contributor

This PR changes the build.gradle files to read the flutter.minSdkVersion and flutter.targetSdkVersion from the generated local.properties, and if not found, keep the default one (which is set at flutter.gradle)

It changes all build.gradle files from examples/* and the integration_test/example.
It doesn't change build.gradle files from dev projects at dev/* but they can be changed too upon further request.
It changes both java and kotlin build.gradle templates.
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 on local.properties doesn't change the value set at flutter.gradle, this can also be added upon further request.

This PR also changes flutter.gradle to detect and warn the developer with a logger.quiet message about mismatches with plugins API level. If a mismatch is found, it also checks if the variables flutter.minSdkVersion and flutter.targetSdkVersion were set at local.properties

It also changes the gradle_errors.dart to 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.

image

[After] New project with a dependency requiring higher sdk version.

image

[After] New project with the variables INcorrectly set at local.properties.

image

[After] New project with the variables correctly set at local.properties.

image

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_ROOT variable in order to run tests.

@flutter-dashboard flutter-dashboard bot added d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos documentation f: integration_test The flutter/packages/integration_test plugin team Infra upgrades, team productivity, code health, technical debt. See also team: labels. tool Affects the "flutter" command-line tool. See also t: labels. labels Feb 14, 2022
@camsim99 camsim99 self-requested a review February 15, 2022 17:08
Copy link
Contributor

@camsim99 camsim99 left a comment

Choose a reason for hiding this comment

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

To be consistent with #95684

@tatsuyuki25
Copy link

How to set this properties on CI server? the local.properties in .gitignore, no upload to git repository.

@brunotacca
Copy link
Contributor Author

PTAL @christopherfujino

@fluttergithubbot
Copy link
Contributor

This pull request is not suitable for automatic merging in its current state.

  • Please get at least one approved review if you are already a member or two member reviews if you are not a member before re-applying this label. Reviewers: If you left a comment approving, please use the "approve" review action instead.

Copy link
Member

@christopherfujino christopherfujino 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 37a1aaf into flutter:master Feb 24, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 24, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Feb 25, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Feb 25, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Feb 25, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Feb 27, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Feb 28, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Feb 28, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Feb 28, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Feb 28, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Feb 28, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Feb 28, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Feb 28, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Feb 28, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Feb 28, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Feb 28, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Feb 28, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Feb 28, 2022
clocksmith pushed a commit to clocksmith/flutter that referenced this pull request Mar 8, 2022
@SPiercer
Copy link

SPiercer commented Oct 6, 2022

quick question do i just add the values in the local.properties ?

flutter.buildMode=debug
flutter.versionName=1.0.0
flutter.versionCode=1
flutter.minSdkVersion=19
flutter.targetSdkVersion=31
flutter.compileSdkVersion=33

like so or i'm missing something ?

@camsim99
Copy link
Contributor

@SPiercer Looks like this change was reverted in #99191. You can update the minSdkVersion and targetSdkVersion directly in the build.gradle configuration file located at [your project]/android/app . For more information, see https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos f: integration_test The flutter/packages/integration_test plugin team Infra upgrades, team productivity, code health, technical debt. See also team: labels. tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Android] build.gradle defaultConfig with local.properties not working properly.
7 participants