[flutter_tools] delete entitlements files after copying to macos build dir (#127417)
Fixes https://github.com/flutter/flutter/issues/126705 Follow up fix after https://github.com/flutter/flutter/pull/126875 did NOT work.
This commit is contained in:
committed by
GitHub
parent
3518d69d2a
commit
11cb29174f
@@ -62,6 +62,8 @@ abstract class UnpackMacOS extends Target {
|
||||
basePath,
|
||||
environment.outputDir.path,
|
||||
]);
|
||||
|
||||
_removeDenylistedFiles(environment.outputDir);
|
||||
if (result.exitCode != 0) {
|
||||
throw Exception(
|
||||
'Failed to copy framework (exit ${result.exitCode}:\n'
|
||||
@@ -81,6 +83,19 @@ abstract class UnpackMacOS extends Target {
|
||||
_thinFramework(environment, frameworkBinaryPath);
|
||||
}
|
||||
|
||||
static const List<String> _copyDenylist = <String>['entitlements.txt', 'without_entitlements.txt'];
|
||||
|
||||
void _removeDenylistedFiles(Directory directory) {
|
||||
for (final FileSystemEntity entity in directory.listSync(recursive: true)) {
|
||||
if (entity is! File) {
|
||||
continue;
|
||||
}
|
||||
if (_copyDenylist.contains(entity.basename)) {
|
||||
entity.deleteSync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void _thinFramework(Environment environment, String frameworkBinaryPath) {
|
||||
final String archs = environment.defines[kDarwinArchs] ?? 'x86_64 arm64';
|
||||
final List<String> archList = archs.split(' ').toList();
|
||||
|
||||
Reference in New Issue
Block a user