Skip to content

Commit 6d2b5ea

Browse files
authored
Fix inconsistently suffixed macOS flavored bundle directory (#127997)
The current implementation of macOS flavor support (#119564) assumes a bundle directory that differs from both the iOS implementation and the official documentation. The [documentation](https://docs.flutter.dev/deployment/flavors) instructs developers to suffix their Xcode build configurations with `-<flavor>`, but the implementation assumes a space: https://github.com/flutter/flutter/blob/5fd9ef4240d3fc239f042f49b8eb1ad24260091f/packages/flutter_tools/lib/src/macos/application_package.dart#L174-L178 Whereas the iOS implementation, which is the reference for the docs, assumes a `-<flavor>` suffix: https://github.com/flutter/flutter/blob/a257efc2841ed7042322fbd043f0983e705d7da2/packages/flutter_tools/lib/src/ios/xcodeproj.dart#L482-L488 This change replaces the empty space with the `-` character which is in line with the documentation and iOS implementation, as well as removing the sentence-casing applied to the flavor name; every bundle built with a flavor keeps the original flavor name in its filename. *List which issues are fixed by this PR. You must list at least one issue.* #122684. *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
1 parent 7d95086 commit 6d2b5ea

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/flutter_tools/lib/src/macos/application_package.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ class BuildableMacOSApp extends MacOSApp {
173173

174174
String bundleDirectory(BuildInfo buildInfo) {
175175
return sentenceCase(buildInfo.mode.cliName) + (buildInfo.flavor != null
176-
? ' ${sentenceCase(buildInfo.flavor!)}'
176+
? '-${buildInfo.flavor!}'
177177
: '');
178178
}
179179

packages/flutter_tools/test/general.shard/macos/application_package_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ group('PrebuiltMacOSApp', () {
167167

168168
const BuildInfo flavoredApp = BuildInfo(BuildMode.release, 'flavor', treeShakeIcons: false);
169169
applicationBundle = macosApp.bundleDirectory(flavoredApp);
170-
expect(applicationBundle, 'Release Flavor');
170+
expect(applicationBundle, 'Release-flavor');
171171

172172
}, overrides: overrides);
173173
});

0 commit comments

Comments
 (0)