From 761b109bc8a9eb2239d44a3d67cded227ccf7049 Mon Sep 17 00:00:00 2001 From: Zachary Anderson Date: Mon, 24 Jan 2022 10:21:22 -0800 Subject: [PATCH] Adjust lipo thinning input/output for macOS (#97111) --- .../lib/src/build_system/targets/macos.dart | 8 ++++++-- .../general.shard/build_system/targets/macos_test.dart | 10 ++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/flutter_tools/lib/src/build_system/targets/macos.dart b/packages/flutter_tools/lib/src/build_system/targets/macos.dart index 53b3028829f..1af2e3bef4a 100644 --- a/packages/flutter_tools/lib/src/build_system/targets/macos.dart +++ b/packages/flutter_tools/lib/src/build_system/targets/macos.dart @@ -36,7 +36,7 @@ abstract class UnpackMacOS extends Target { @override List get outputs => const [ - Source.pattern('{OUTPUT_DIR}/FlutterMacOS.framework/FlutterMacOS'), + Source.pattern('{OUTPUT_DIR}/FlutterMacOS.framework/Versions/A/FlutterMacOS'), ]; @override @@ -67,7 +67,11 @@ abstract class UnpackMacOS extends Target { ); } - final File frameworkBinary = environment.outputDir.childDirectory('FlutterMacOS.framework').childFile('FlutterMacOS'); + final File frameworkBinary = environment.outputDir + .childDirectory('FlutterMacOS.framework') + .childDirectory('Versions') + .childDirectory('A') + .childFile('FlutterMacOS'); final String frameworkBinaryPath = frameworkBinary.path; if (!frameworkBinary.existsSync()) { throw Exception('Binary $frameworkBinaryPath does not exist, cannot thin'); diff --git a/packages/flutter_tools/test/general.shard/build_system/targets/macos_test.dart b/packages/flutter_tools/test/general.shard/build_system/targets/macos_test.dart index f57c348f321..6dd64800726 100644 --- a/packages/flutter_tools/test/general.shard/build_system/targets/macos_test.dart +++ b/packages/flutter_tools/test/general.shard/build_system/targets/macos_test.dart @@ -51,8 +51,10 @@ void main() { ); binary = environment.outputDir - .childDirectory('FlutterMacOS.framework') - .childFile('FlutterMacOS'); + .childDirectory('FlutterMacOS.framework') + .childDirectory('Versions') + .childDirectory('A') + .childFile('FlutterMacOS'); copyFrameworkCommand = FakeCommand( command: [ @@ -109,7 +111,7 @@ void main() { throwsA(isException.having( (Exception exception) => exception.toString(), 'description', - contains('FlutterMacOS.framework/FlutterMacOS does not exist, cannot thin'), + contains('FlutterMacOS.framework/Versions/A/FlutterMacOS does not exist, cannot thin'), )), ); }, overrides: { @@ -155,7 +157,7 @@ void main() { await const DebugUnpackMacOS().build(environment); - expect(logger.traceText, contains('Skipping lipo for non-fat file /FlutterMacOS.framework/FlutterMacOS')); + expect(logger.traceText, contains('Skipping lipo for non-fat file /FlutterMacOS.framework/Versions/A/FlutterMacOS')); }); testUsingContext('thins fat framework', () async {