Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Migrate to Gradle 7.0.2 and AGP 7.0.0 #87761

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

Closed
wants to merge 20 commits into from
Closed

Migrate to Gradle 7.0.2 and AGP 7.0.0 #87761

wants to merge 20 commits into from

Conversation

TahaTesser
Copy link
Member

  • Migrated tools to Gradle 7.0.2 and AGP 7.0.0 (updated tests too).
  • Migrated templates to Gradle 7.0.2 and AGP 7.0.0.
  • Migrated flutter/dev samples to Gradle 7.0.2 and AGP 7.0.0.
  • Migrated flutter/examples to Gradle 7.0.2 and AGP 7.0.0.
  • Migrated packages/integration_test & packages/integration_test/example to Gradle 7.0.2 and AGP 7.0.0.

Fixes #87649

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot added a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) d: examples Sample code and demos c: contributor-productivity Team-specific productivity, code health, technical debt. tool Affects the "flutter" command-line tool. See also t: labels. labels Aug 5, 2021
@TahaTesser TahaTesser requested a review from blasten August 5, 2021 22:14
@google-cla google-cla bot added the cla: yes label Aug 5, 2021
@TahaTesser
Copy link
Member Author

@blasten
Tests fails as Java 11 is required for AGP 7.0.0+ 😅

@blasten
Copy link

blasten commented Aug 6, 2021

@TahaTesser perfect timing.

cc @CaseyHillers @godofredoc . Would it be possible to prioritize the work needed to get flutter_deps working on a PR like this? e.g. parse .ci.yaml in LUCI and set the JAVA_HOME & PATH based on the content of this file.

@CaseyHillers
Copy link
Contributor

cc @CaseyHillers @godofredoc . Would it be possible to prioritize the work needed to get flutter_deps working on a PR like this? e.g. parse .ci.yaml in LUCI and set the JAVA_HOME & PATH based on the content of this file.

I could send a PR that changes it so presubmit uses the latest presubmit dependencies from ci.yaml. However, it would temporarily break tip of tree until the luci config change has propagated into prod. @blasten what is the current process for updating deps like this? Is it expected to be a hard break?

@godofredoc
Copy link
Contributor

t be possible to prio

@TahaTesser perfect timing.

cc @CaseyHillers @godofredoc . Would it be possible to prioritize the work needed to get flutter_deps working on a PR like this? e.g. parse .ci.yaml in LUCI and set the JAVA_HOME & PATH based on the content of this file.

The only change required from the infra point of view is to update the version of the cipd dependency. @blasten are the new cipd packages ready?

@blasten
Copy link

blasten commented Aug 6, 2021

It's not a breaking change. This change primarily affects someone who creates a new app using flutter create. Ideally, we keep a test that uses the current version of Gradle and JAVA version.

@blasten
Copy link

blasten commented Aug 6, 2021

are the new cipd packages ready?

Yes. However, @CaseyHillers mentioned that changes like this cannot be tested in the PR

@godofredoc
Copy link
Contributor

t be possible to prio

@TahaTesser perfect timing.
cc @CaseyHillers @godofredoc . Would it be possible to prioritize the work needed to get flutter_deps working on a PR like this? e.g. parse .ci.yaml in LUCI and set the JAVA_HOME & PATH based on the content of this file.

The only change required from the infra point of view is to update the version of the cipd dependency. @blasten are the new cipd packages ready?

Actually took a look and it seems like the new versions are there. The only change needed is to set "version": "version:11" in all the places using openjdk e.g. https://github.com/flutter/flutter/blob/master/.ci.yaml#L102 here is an example: https://github.com/flutter/engine/blob/master/.ci.yaml#L25

@blasten
Copy link

blasten commented Aug 6, 2021

The only change needed is to set "version": "version:11" in all the places using openjdk

@godofredoc I thought that changes aren't propagated automatically in the PR. Is that the case? PRs like this that also have dependencies on the environment cannot be landed easily unless everything is pushed atomically.

@godofredoc
Copy link
Contributor

The only change needed is to set "version": "version:11" in all the places using openjdk

@godofredoc I thought that changes aren't propagated automatically in the PR. Is that the case? PRs like this that also have dependencies on the environment cannot be landed easily unless everything is pushed atomically.

Post-submit like device lab won't be tested but as long as presubmit ones + manual executions of 1 linux, 1 mac and 1 windows device lab tests are successful we can have high confidence the new jdk will work properly.

@CaseyHillers
Copy link
Contributor

I added some documentation in flutter/cocoon#1321

From an infra perspective, it's easier to support bring up builders intended to validate new versions like this. There's a few race conditions that require more extensive work to iron out to support this functionality in presubmit.

@christopherfujino
Copy link
Contributor

@CaseyHillers, @godofredoc, @blasten
So what is the way forward to land this?

@blasten
Copy link

blasten commented Aug 12, 2021

The current solution is described in https://github.com/CaseyHillers/cocoon/blob/1f1fa81e2588904908d613111a9d72e784cc6e24/CI_YAML.md#upgrading-dependencies

I wanted to try this by myself, and send a PR to see

@blasten
Copy link

blasten commented Aug 23, 2021

@TahaTesser I migrated the complex_layout tests to Gradle/AGP 7.0. You can see the PR here: #88540

Steps

  1. Bump the AGP version in android/build.gradle
  2. Bump the Gradle version in android/gradle/wrapper/gradle-wrapper.properties
  3. Cd into android and run ./gradlew generateLockfiles
  4. Add the dependencies to each task in .ci.yaml See Reland: Bump to Gradle 7 and use Open JDK 11 #88540 for reference.
  5. Mark each test as flaky. (add bringup: true)
  6. Get LGTM, and merge.
  7. Check the status of each task on https://flutter-dashboard.appspot.com/
  8. If the tree got red because one of the task is not passing, then revert, fix, and reland.
  9. If the tree is green, but one of the task flagged as flaky is not passing, then fix forward. (Send another PR with the fix)
  10. Once all the tasks are passing, send another PR to remove bringup: true from the tasks in .ci.yaml.

@TahaTesser
Copy link
Member Author

TahaTesser commented Aug 24, 2021

@blasten
I have all updated samples, updated Gradle lock files, ci.yaml for all the ci tasks that I could find under flutter/dev and all the ci tasks that were failing here

Now only ci_yaml flutter roller fails for some reason, I cannot figure out why.

@CaseyHillers
Copy link
Contributor

CaseyHillers commented Aug 24, 2021

Several of the blocks in ci.yaml have to be json parseable, so Linux ci_yaml flutter roller is ensuring all properties are json encoded. Usually this means an unnecessary trailing comma. I reviewed the file and didn't find any other issues.

@TahaTesser

This comment has been minimized.

@TahaTesser

This comment has been minimized.

@TahaTesser
Copy link
Member Author

@blasten
All green, thanks to @CaseyHillers ci_yaml flutter roller is resolved

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

@TahaTesser
Copy link
Member Author

@blasten
I'm not sure if I can proceed with other steps without supervision
Feel to merge it for me, if changes are needed, please revert, I'm happy to help with further changes

@blasten
Copy link

blasten commented Sep 20, 2021

@TahaTesser please fix the conflict, and I will merge once all checks are green.

@christopherfujino
Copy link
Contributor

@TahaTesser I'm guessing bad merge due to the size of the diff?

@TahaTesser
Copy link
Member Author

TahaTesser commented Sep 22, 2021

Closing this for a new PR, I will file in a day or two

@TahaTesser TahaTesser closed this Sep 22, 2021
@TahaTesser TahaTesser deleted the migrate_to_agp_7_0_0 branch September 22, 2021 14:38
@TahaTesser TahaTesser mentioned this pull request Sep 23, 2021
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) c: contributor-productivity Team-specific productivity, code health, technical debt. d: examples Sample code and demos tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[flutter_tools] Support for Android Gradle Plugin 7.0.0
5 participants