Skip to content
Merged
Changes from 2 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
19 changes: 18 additions & 1 deletion packages/flutter_tools/lib/src/ios/mac.dart
Original file line number Diff line number Diff line change
Expand Up @@ -541,21 +541,38 @@ Future<XcodeBuildResult> buildXcodeProject({
}

void updateShorebirdYaml(BuildInfo buildInfo, BuildableIOSApp app) {
final String resolvedAppName = app.name ?? 'Runner.app';
final File shorebirdYaml = globals.fs.file(
globals.fs.path.join(
app.archiveBundleOutputPath,
'Products',
'Applications',
app.name ?? 'Runner.app',
resolvedAppName,
'Frameworks',
'App.framework',
'flutter_assets',
'shorebird.yaml',
),
);
if (!shorebirdYaml.existsSync()) {
// Find the closest existing parent of the file.
Directory parent = shorebirdYaml.parent;

int i = 0;
// The max depth is just a hard limit to prevent the cli from going to far behind.
// This limit should never be reached though, since at least the `Applications` or
// `Products` folder should exist, no matter what changed in the app.
const int maxDepth = 6;
while (!parent.existsSync() && i < maxDepth) {
parent = parent.parent;
i++;
}

throw Exception('''
Cannot find shorebird.yaml in ${shorebirdYaml.absolute.path}.
Resolved app name: $resolvedAppName
Closest existing parent: ${parent.absolute.path}

Please file an issue at: https://github.com/shorebirdtech/shorebird/issues/new
''');
}
Expand Down