-
Notifications
You must be signed in to change notification settings - Fork 29.7k
[Reland] Add migrator to upgrade gradle version when conflict with Android Studio bundled Java version is detected #125836
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
…with And… (flutter#125813)" This reverts commit db7196c.
…ode in a try catch
packages/flutter_tools/test/general.shard/android/android_project_migration_test.dart
Show resolved
Hide resolved
| migration.migrate(); | ||
| expect(gradleWrapperPropertiesFile.readAsStringSync(), gradleWrapperToMigrateTo); | ||
| expect(bufferLogger.statusText, contains('Conflict detected between Android Studio Java version and Gradle version, ' | ||
| 'upgrading Gradle version from 6.7 to 7.6.1.')); |
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.
Consider using the constants defined here so if they upgrader uses a different version this test passes.
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.
I've changed to use the constant defined for version we upgrade to, 7.6.1 (the other version, 6.7, is parsed in the migration method itself so it can't be used here).
| final Version androidStudioFlamingo = Version(2022, 2, 0); | ||
|
|
||
| const String _gradleVersion7_6_1 = r'7.6.1'; | ||
| const String gradleVersion7_6_1 = r'7.6.1'; |
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.
I think this should be annotated @VisibleForTesting
|
Removing autosubmit briefly to test an assumption about RegExp group counts. |
|
Since last approval, I wrapped two different values returned by RegExpMatch group(). The main reason is that it is possible in a case like for |
… with Android Studio bundled Java version is detected (flutter/flutter#125836)
… with Android Studio bundled Java version is detected (flutter/flutter#125836)
… with Android Studio bundled Java version is detected (flutter/flutter#125836)
…droid Studio bundled Java version is detected (flutter#125836) This is an attempt to reland flutter#124085. Differences from this attempt and the last: 1. Adds a check for null android studio versions and a test for this case. 2. Wraps the migrate code in a try-catch [per the suggestion here](https://github.com/flutter/flutter/pull/125728/files#r1181747899). Old PR description: This PR adds an android project migrator that checks the version of android studio and the version of gradle for conflicts, and upgrades to 7.4 if a conflict is detected. For more detail about the particular conflict, see flutter#122376. The PR also upgrades older gradle versions being used in integration testing to 7.4. Fixes/related to: flutter#122376 and flutter#123636
… with Android Studio bundled Java version is detected (flutter/flutter#125836)
… with Android Studio bundled Java version is detected (flutter/flutter#125836)
…droid Studio bundled Java version is detected (flutter#125836) This is an attempt to reland flutter#124085. Differences from this attempt and the last: 1. Adds a check for null android studio versions and a test for this case. 2. Wraps the migrate code in a try-catch [per the suggestion here](https://github.com/flutter/flutter/pull/125728/files#r1181747899). Old PR description: This PR adds an android project migrator that checks the version of android studio and the version of gradle for conflicts, and upgrades to 7.4 if a conflict is detected. For more detail about the particular conflict, see flutter#122376. The PR also upgrades older gradle versions being used in integration testing to 7.4. Fixes/related to: flutter#122376 and flutter#123636
…d Studio bundled Java version is detected (and 3 others) (#126093) This is a cherry pick of the following four PRs (the first one depends on changes made in the latter three). 1. #125836 2. #124771 3. #123034 4. #123644 For the first PR, Original issue: #122376 Cherry-pick issue: #125693 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [Features we expect every widget to implement]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat --------- Co-authored-by: Reid Baker <[email protected]> Co-authored-by: Mitchell Goodwin <[email protected]> Co-authored-by: Greg Spencer <[email protected]> Co-authored-by: Victoria Ashworth <[email protected]> Co-authored-by: Jackson Gardner <[email protected]> Co-authored-by: Rydmike <[email protected]> Co-authored-by: keyonghan <[email protected]> Co-authored-by: chunhtai <[email protected]> Co-authored-by: Taha Tesser <[email protected]> Co-authored-by: Ben Konyi <[email protected]> Co-authored-by: engine-flutter-autoroll <[email protected]> Co-authored-by: hellohuanlin <[email protected]> Co-authored-by: Danny Tuppeny <[email protected]> Co-authored-by: Chris Bracken <[email protected]> Co-authored-by: Kate Lovett <[email protected]> Co-authored-by: Michael Goderbauer <[email protected]> Co-authored-by: Elias Yishak <[email protected]> Co-authored-by: Christopher Fujino <[email protected]> Co-authored-by: Andrew Kolos <[email protected]>
… with Android Studio bundled Java version is detected (flutter/flutter#125836)
… with Android Studio bundled Java version is detected (flutter/flutter#125836)
… with Android Studio bundled Java version is detected (flutter/flutter#125836)
… with Android Studio bundled Java version is detected (flutter/flutter#125836)
…d Studio bundled Java version is detected (and 3 others) (flutter#126093) This is a cherry pick of the following four PRs (the first one depends on changes made in the latter three). 1. flutter#125836 2. flutter#124771 3. flutter#123034 4. flutter#123644 For the first PR, Original issue: flutter#122376 Cherry-pick issue: flutter#125693 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [Features we expect every widget to implement]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat --------- Co-authored-by: Reid Baker <[email protected]> Co-authored-by: Mitchell Goodwin <[email protected]> Co-authored-by: Greg Spencer <[email protected]> Co-authored-by: Victoria Ashworth <[email protected]> Co-authored-by: Jackson Gardner <[email protected]> Co-authored-by: Rydmike <[email protected]> Co-authored-by: keyonghan <[email protected]> Co-authored-by: chunhtai <[email protected]> Co-authored-by: Taha Tesser <[email protected]> Co-authored-by: Ben Konyi <[email protected]> Co-authored-by: engine-flutter-autoroll <[email protected]> Co-authored-by: hellohuanlin <[email protected]> Co-authored-by: Danny Tuppeny <[email protected]> Co-authored-by: Chris Bracken <[email protected]> Co-authored-by: Kate Lovett <[email protected]> Co-authored-by: Michael Goderbauer <[email protected]> Co-authored-by: Elias Yishak <[email protected]> Co-authored-by: Christopher Fujino <[email protected]> Co-authored-by: Andrew Kolos <[email protected]>
…d Studio bundled Java version is detected (and 3 others) (flutter#126093) This is a cherry pick of the following four PRs (the first one depends on changes made in the latter three). 1. flutter#125836 2. flutter#124771 3. flutter#123034 4. flutter#123644 For the first PR, Original issue: flutter#122376 Cherry-pick issue: flutter#125693 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [Features we expect every widget to implement]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat --------- Co-authored-by: Reid Baker <[email protected]> Co-authored-by: Mitchell Goodwin <[email protected]> Co-authored-by: Greg Spencer <[email protected]> Co-authored-by: Victoria Ashworth <[email protected]> Co-authored-by: Jackson Gardner <[email protected]> Co-authored-by: Rydmike <[email protected]> Co-authored-by: keyonghan <[email protected]> Co-authored-by: chunhtai <[email protected]> Co-authored-by: Taha Tesser <[email protected]> Co-authored-by: Ben Konyi <[email protected]> Co-authored-by: engine-flutter-autoroll <[email protected]> Co-authored-by: hellohuanlin <[email protected]> Co-authored-by: Danny Tuppeny <[email protected]> Co-authored-by: Chris Bracken <[email protected]> Co-authored-by: Kate Lovett <[email protected]> Co-authored-by: Michael Goderbauer <[email protected]> Co-authored-by: Elias Yishak <[email protected]> Co-authored-by: Christopher Fujino <[email protected]> Co-authored-by: Andrew Kolos <[email protected]>
This is an attempt to reland #124085.
Differences from this attempt and the last:
Old PR description:
This PR adds an android project migrator that checks the version of android studio and the version of gradle for conflicts, and upgrades to 7.4 if a conflict is detected. For more detail about the particular conflict, see #122376.
The PR also upgrades older gradle versions being used in integration testing to 7.4.
Fixes/related to: #122376 and #123636
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.