Skip to content

Commit 9611267

Browse files
felangelbryanoltman
authored andcommitted
fix(flutter_tools): improve shorebird.yaml detection on iOS (#18)
1 parent 05862ff commit 9611267

File tree

1 file changed

+8
-5
lines changed
  • packages/flutter_tools/lib/src/ios

1 file changed

+8
-5
lines changed

packages/flutter_tools/lib/src/ios/mac.dart

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ Future<XcodeBuildResult> buildXcodeProject({
500500
}
501501

502502
try {
503-
updateShorebirdYaml(buildInfo, app.archiveBundleOutputPath);
503+
updateShorebirdYaml(buildInfo, app);
504504
} on Exception catch (error) {
505505
globals.printError('[shorebird] failed to generate shorebird configuration.\n$error');
506506
return XcodeBuildResult(success: false);
@@ -520,21 +520,24 @@ Future<XcodeBuildResult> buildXcodeProject({
520520
}
521521
}
522522

523-
void updateShorebirdYaml(BuildInfo buildInfo, String xcarchivePath) {
523+
void updateShorebirdYaml(BuildInfo buildInfo, BuildableIOSApp app) {
524524
final File shorebirdYaml = globals.fs.file(
525525
globals.fs.path.join(
526-
xcarchivePath,
526+
app.archiveBundleOutputPath,
527527
'Products',
528528
'Applications',
529-
'Runner.app',
529+
app.name ?? 'Runner.app',
530530
'Frameworks',
531531
'App.framework',
532532
'flutter_assets',
533533
'shorebird.yaml',
534534
),
535535
);
536536
if (!shorebirdYaml.existsSync()) {
537-
throw Exception('shorebird.yaml not found.');
537+
throw Exception('''
538+
Cannot find shorebird.yaml in ${shorebirdYaml.absolute.path}.
539+
Please file an issue at: https://github.com/shorebirdtech/shorebird/issues/new
540+
''');
538541
}
539542
final YamlDocument yaml = loadYamlDocument(shorebirdYaml.readAsStringSync());
540543
final YamlMap yamlMap = yaml.contents as YamlMap;

0 commit comments

Comments
 (0)