flutter/packages
Matan Lurey 8e8cb92553
Roll forward: "Initialize default-app-flavor" (#169298) (#169602)
Closes https://github.com/flutter/flutter/issues/169598 (which explains
the integration test failure).
Closes https://github.com/flutter/flutter/issues/169160.
Closes https://github.com/flutter/flutter/issues/165803.

This is the only diff from 5d013c73ba:
```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 61583210e47..67731019a05 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 https://github.com/flutter/flutter/issues/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');
   }
 }
 ```
2025-05-28 20:15:01 +00:00
..
flutter unskip text_painter_rtl_test on web (#169537) 2025-05-28 20:11:20 +00:00
flutter_driver Manually update vector_math package (#169476) 2025-05-28 15:55:01 +00:00
flutter_goldens Manually update vector_math package (#169476) 2025-05-28 15:55:01 +00:00
flutter_localizations Manually update vector_math package (#169476) 2025-05-28 15:55:01 +00:00
flutter_test Manually update vector_math package (#169476) 2025-05-28 15:55:01 +00:00
flutter_tools Roll forward: "Initialize default-app-flavor" (#169298) (#169602) 2025-05-28 20:15:01 +00:00
flutter_web_plugins Manually update vector_math package (#169476) 2025-05-28 15:55:01 +00:00
fuchsia_remote_debug_protocol Reverts "Add workspace (#169451)" (#169468) 2025-05-26 14:07:27 +00:00
integration_test Manually update vector_math package (#169476) 2025-05-28 15:55:01 +00:00
analysis_options.yaml Update old wiki links (#149544) 2024-06-17 17:26:08 +00:00