[macOS] Flavors project throws no flavor specified
for creating a project. (#113979)
This commit is contained in:
parent
b373be8891
commit
92d8b04bac
@ -138,10 +138,17 @@ class FlutterProject {
|
|||||||
// Don't require iOS build info, this method is only
|
// Don't require iOS build info, this method is only
|
||||||
// used during create as best-effort, use the
|
// used during create as best-effort, use the
|
||||||
// default target bundle identifier.
|
// default target bundle identifier.
|
||||||
|
try {
|
||||||
final String? bundleIdentifier = await ios.productBundleIdentifier(null);
|
final String? bundleIdentifier = await ios.productBundleIdentifier(null);
|
||||||
if (bundleIdentifier != null) {
|
if (bundleIdentifier != null) {
|
||||||
candidates.add(bundleIdentifier);
|
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()) {
|
if (android.existsSync()) {
|
||||||
final String? applicationId = android.applicationId;
|
final String? applicationId = android.applicationId;
|
||||||
|
@ -509,6 +509,17 @@ apply plugin: 'kotlin-android'
|
|||||||
expect(await project.ios.productBundleIdentifier(null), 'io.flutter.someProject.suffix');
|
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 {
|
testWithMocks('fails with no flavor and defined schemes', () async {
|
||||||
final FlutterProject project = await someProject();
|
final FlutterProject project = await someProject();
|
||||||
project.ios.xcodeProject.createSync();
|
project.ios.xcodeProject.createSync();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user