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:
parent
dad3fea650
commit
bade5591bf
@ -188,15 +188,25 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
|
|||||||
'vm_snapshot_data',
|
'vm_snapshot_data',
|
||||||
));
|
));
|
||||||
|
|
||||||
|
final String dsymPath = path.join(
|
||||||
|
outputPath,
|
||||||
|
mode,
|
||||||
|
'App.xcframework',
|
||||||
|
'ios-arm64',
|
||||||
|
'dSYMs'
|
||||||
|
);
|
||||||
|
checkDirectoryExists(dsymPath);
|
||||||
|
|
||||||
final String appFrameworkDsymPath = path.join(
|
final String appFrameworkDsymPath = path.join(
|
||||||
outputPath,
|
dsymPath,
|
||||||
mode,
|
'App.framework.dSYM'
|
||||||
'App.xcframework',
|
|
||||||
'ios-arm64',
|
|
||||||
'dSYMs',
|
|
||||||
'App.framework.dSYM'
|
|
||||||
);
|
);
|
||||||
checkDirectoryExists(appFrameworkDsymPath);
|
checkDirectoryExists(appFrameworkDsymPath);
|
||||||
|
|
||||||
|
if (Directory(dsymPath).listSync().whereType<Directory>().length != 1) {
|
||||||
|
throw TaskResult.failure('App.framework/dSYMs should ONLY contain App.xcframework.dSYM');
|
||||||
|
}
|
||||||
|
|
||||||
await _checkDsym(path.join(
|
await _checkDsym(path.join(
|
||||||
appFrameworkDsymPath,
|
appFrameworkDsymPath,
|
||||||
'Contents',
|
'Contents',
|
||||||
|
@ -150,7 +150,7 @@ abstract class BuildFrameworkCommand extends BuildSubCommand {
|
|||||||
...framework.parent
|
...framework.parent
|
||||||
.listSync()
|
.listSync()
|
||||||
.where((FileSystemEntity entity) =>
|
.where((FileSystemEntity entity) =>
|
||||||
entity.basename.endsWith('dSYM'))
|
entity.basename.endsWith('dSYM') && !entity.basename.startsWith('Flutter'))
|
||||||
.map((FileSystemEntity entity) => <String>['-debug-symbols', entity.path])
|
.map((FileSystemEntity entity) => <String>['-debug-symbols', entity.path])
|
||||||
.expand<String>((List<String> parameter) => parameter),
|
.expand<String>((List<String> parameter) => parameter),
|
||||||
],
|
],
|
||||||
|
@ -558,6 +558,8 @@ void main() {
|
|||||||
final Directory parentA = fileSystem.directory('FrameworkA')..createSync();
|
final Directory parentA = fileSystem.directory('FrameworkA')..createSync();
|
||||||
final File dSYMA = parentA.childFile('FrameworkA.framework.dSYM')..createSync();
|
final File dSYMA = parentA.childFile('FrameworkA.framework.dSYM')..createSync();
|
||||||
final Directory frameworkA = parentA.childDirectory('FrameworkA.framework')..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 Directory parentB = fileSystem.directory('FrameworkB')..createSync();
|
||||||
final File dSYMB = parentB.childFile('FrameworkB.framework.dSYM')..createSync();
|
final File dSYMB = parentB.childFile('FrameworkB.framework.dSYM')..createSync();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user