Unverified Commit 92d8b04b authored by Alex Wallen's avatar Alex Wallen Committed by GitHub

[macOS] Flavors project throws `no flavor specified` for creating a project. (#113979)

parent b373be88
......@@ -138,9 +138,16 @@ class FlutterProject {
// Don't require iOS build info, this method is only
// used during create as best-effort, use the
// default target bundle identifier.
final String? bundleIdentifier = await ios.productBundleIdentifier(null);
if (bundleIdentifier != null) {
candidates.add(bundleIdentifier);
try {
final String? bundleIdentifier = await ios.productBundleIdentifier(null);
if (bundleIdentifier != null) {
candidates.add(bundleIdentifier);
}
} on ToolExit {
// It's possible that while parsing the build info for the ios project
// that the bundleIdentifier can't be resolve. However, we would like
// skip parsing that id in favor of searching in other place. We can
// consider a tool exit in this case to be non fatal for the program.
}
}
if (android.existsSync()) {
......
......@@ -509,6 +509,17 @@ apply plugin: 'kotlin-android'
expect(await project.ios.productBundleIdentifier(null), 'io.flutter.someProject.suffix');
});
testWithMocks('Always pass parsing org on ios project with flavors', () async {
final FlutterProject project = await someProject();
addIosProjectFile(project.directory, projectFileContent: () {
return projectFileWithBundleId('io.flutter.someProject', qualifier: "'");
});
project.ios.xcodeProject.createSync();
xcodeProjectInterpreter.xcodeProjectInfo = XcodeProjectInfo(<String>[], <String>[], <String>['free', 'paid'], logger);
expect(await project.organizationNames, <String>[]);
});
testWithMocks('fails with no flavor and defined schemes', () async {
final FlutterProject project = await someProject();
project.ios.xcodeProject.createSync();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment