Prevent flutter build ios-framework --xcframework from copying Flutter.xcframework.dSYM into the App.framework folder. (#157394)

Fixes https://github.com/flutter/flutter/issues/157359

Prevents Flutter.xcframework.dSYM from being copied into the App.framework folder. I am not 100% positive if there are cases where it's valid to have multiple dSYMs in that folder, so I'm just string matching and filtering out `Flutter.xcframework.dSYM`
This commit is contained in:
LouiseHsu
2024-10-23 16:35:10 -07:00
committed by GitHub
parent dad3fea650
commit bade5591bf
3 changed files with 19 additions and 7 deletions

View File

@@ -150,7 +150,7 @@ abstract class BuildFrameworkCommand extends BuildSubCommand {
...framework.parent
.listSync()
.where((FileSystemEntity entity) =>
entity.basename.endsWith('dSYM'))
entity.basename.endsWith('dSYM') && !entity.basename.startsWith('Flutter'))
.map((FileSystemEntity entity) => <String>['-debug-symbols', entity.path])
.expand<String>((List<String> parameter) => parameter),
],

View File

@@ -558,6 +558,8 @@ void main() {
final Directory parentA = fileSystem.directory('FrameworkA')..createSync();
final File dSYMA = parentA.childFile('FrameworkA.framework.dSYM')..createSync();
final Directory frameworkA = parentA.childDirectory('FrameworkA.framework')..createSync();
// Flutter.framework.dSYM should be correctly filtered out.
parentA.childFile('Flutter.framework.dSYM').createSync();
final Directory parentB = fileSystem.directory('FrameworkB')..createSync();
final File dSYMB = parentB.childFile('FrameworkB.framework.dSYM')..createSync();