Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions packages/flutter_tools/lib/src/ios/mac.dart
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ Future<XcodeBuildResult> buildXcodeProject({
}

try {
updateShorebirdYaml(buildInfo, app.archiveBundleOutputPath);
updateShorebirdYaml(buildInfo, app);
} on Exception catch (error) {
globals.printError('[shorebird] failed to generate shorebird configuration.\n$error');
return XcodeBuildResult(success: false);
Expand All @@ -500,21 +500,24 @@ Future<XcodeBuildResult> buildXcodeProject({
}
}

void updateShorebirdYaml(BuildInfo buildInfo, String xcarchivePath) {
void updateShorebirdYaml(BuildInfo buildInfo, BuildableIOSApp app) {
final File shorebirdYaml = globals.fs.file(
globals.fs.path.join(
xcarchivePath,
app.archiveBundleOutputPath,
'Products',
'Applications',
'Runner.app',
app.name ?? 'Runner.app',
'Frameworks',
'App.framework',
'flutter_assets',
'shorebird.yaml',
),
);
if (!shorebirdYaml.existsSync()) {
throw Exception('shorebird.yaml not found.');
throw Exception('''
Cannot find shorebird.yaml in ${shorebirdYaml.absolute.path}.
Please file an issue at: https://github.com/shorebirdtech/shorebird/issues/new
''');
}
final YamlDocument yaml = loadYamlDocument(shorebirdYaml.readAsStringSync());
final YamlMap yamlMap = yaml.contents as YamlMap;
Expand Down