-
Notifications
You must be signed in to change notification settings - Fork 29.7k
[CP-stable]Roll forward: "Initialize default-app-flavor" (#169298) #169623
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
[CP-stable]Roll forward: "Initialize default-app-flavor" (#169298) #169623
Conversation
…er#169602) Closes flutter#169598 (which explains the integration test failure). Closes flutter#169160. Closes flutter#165803. This is the only diff from 5d013c7: ```diff diff --git a/packages/flutter_tools/lib/src/build_system/targets/common.dart b/packages/flutter_tools/lib/src/build_system/targets/common.dart index 6158321..6773101 100644 --- a/packages/flutter_tools/lib/src/build_system/targets/common.dart +++ b/packages/flutter_tools/lib/src/build_system/targets/common.dart @@ -308,10 +308,18 @@ class KernelSnapshot extends Target { if (flavor == null) { return; } - if (!dartDefines.any((String element) => element.startsWith(kAppFlavor))) { - // If the flavor is not already in the dart defines, add it. - dartDefines.add('$kAppFlavor=$flavor'); - } + + // It is possible there is a flavor already in dartDefines, from another + // part of the build process, but this should take precedence as it happens + // last (xcodebuild execution). + // + // See flutter#169598. + + // If the flavor is already in the dart defines, remove it. + dartDefines.removeWhere((String define) => define.startsWith(kAppFlavor)); + + // Then, add it to the end. + dartDefines.add('$kAppFlavor=$flavor'); } } ```
|
@matanlurey please fill out the PR description above, afterwards the release team will review this request. |
|
This pull request was opened from and to a release candidate branch. This should only be done as part of the official Flutter release process. If you are attempting to make a regular contribution to the Flutter project, please close this PR and follow the instructions at Tree Hygiene for detailed instructions on contributing to Flutter. Reviewers: Use caution before merging pull requests to release branches. Ensure the proper procedure has been followed. |
reidbaker
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.
Approved with 2 changes.
Please add a comment with your plan on when you will update the change log since 3.32 is stable.
Please update your changelog entry to match the formatting expectations in https://github.com/flutter/flutter/blob/master/docs/releases/Hotfix-Documentation-Best-Practices.md
|
I'll start a CHANGELOG update now in another PR to avoid re-running every test. |
0a159b3
into
flutter:flutter-3.32-candidate.0
This pull request is created by automatic cherry pick workflow
Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request.
Issue Link:
What is the link to the issue this cherry-pick is addressing?
#169602
Changelog Description:
Explain this cherry pick in one line that is accessible to most Flutter developers. See best practices for examples
Fixes a bug where
appFlavorisnullwhen being run withflutter testor being hot-restarted.Impact Description:
What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)? Does it impact development (ex. flutter doctor crashes when Android Studio is installed), or the shipping production app (the app crashes on launch)
Cannot reliably use
appFlavorwithout rebuilding the app from scratch.Workaround:
Is there a workaround for this issue?
Do not use hot restart, do not use
flutter test.Risk:
What is the risk level of this cherry-pick?
Test Coverage:
Are you confident that your fix is well-tested by automated tests?
Validation Steps:
What are the steps to validate that this fix works?
Automated test coverage.