From 03013ce42a0a70ef06916685587cb19b1f5e591d Mon Sep 17 00:00:00 2001 From: Jenn Magder Date: Mon, 7 Dec 2020 13:49:11 -0800 Subject: [PATCH] Remove manual Flutter linking for iOS projects (#71862) --- .../flutter_tools/lib/src/ios/xcodeproj.dart | 5 -- .../general.shard/ios/xcodeproj_test.dart | 57 ------------------- 2 files changed, 62 deletions(-) diff --git a/packages/flutter_tools/lib/src/ios/xcodeproj.dart b/packages/flutter_tools/lib/src/ios/xcodeproj.dart index 55a5e5d17d..f47556d89f 100644 --- a/packages/flutter_tools/lib/src/ios/xcodeproj.dart +++ b/packages/flutter_tools/lib/src/ios/xcodeproj.dart @@ -181,11 +181,6 @@ List _xcodeBuildSettingsLines({ xcodeBuildSettings.add('SYMROOT=\${SOURCE_ROOT}/../${getIosBuildDirectory()}'); } - // iOS does not link on Flutter in any build phase. Add the linker flag. - if (!useMacOSConfig) { - xcodeBuildSettings.add(r'OTHER_LDFLAGS=$(inherited) -framework Flutter'); - } - if (!project.isModule && useMacOSConfig) { // For module projects we do not want to write the FLUTTER_FRAMEWORK_DIR // explicitly. Rather we rely on the xcode backend script and the Podfile diff --git a/packages/flutter_tools/test/general.shard/ios/xcodeproj_test.dart b/packages/flutter_tools/test/general.shard/ios/xcodeproj_test.dart index 75b1bae8f2..30b3b686f6 100644 --- a/packages/flutter_tools/test/general.shard/ios/xcodeproj_test.dart +++ b/packages/flutter_tools/test/general.shard/ios/xcodeproj_test.dart @@ -663,63 +663,6 @@ Information about project "Runner": }); } - testUsingOsxContext('sets OTHER_LDFLAGS for iOS', () async { - when(mockArtifacts.getArtifactPath(Artifact.flutterFramework, - platform: TargetPlatform.ios, - mode: anyNamed('mode'), - environmentType: anyNamed('environmentType'))) - .thenReturn(fs.path.join('engine', 'Flutter.framework')); - when(mockArtifacts.engineOutPath).thenReturn(fs.path.join('out', 'ios_profile_arm')); - - const BuildInfo buildInfo = BuildInfo(BuildMode.debug, null, treeShakeIcons: false); - final FlutterProject project = FlutterProject.fromPath('path/to/project'); - await updateGeneratedXcodeProperties( - project: project, - buildInfo: buildInfo, - ); - - final File config = fs.file('path/to/project/ios/Flutter/Generated.xcconfig'); - expect(config.existsSync(), isTrue); - - final String contents = config.readAsStringSync(); - expect(contents.contains(r'OTHER_LDFLAGS=$(inherited) -framework Flutter'), isTrue); - - final File buildPhaseScript = fs.file('path/to/project/ios/Flutter/flutter_export_environment.sh'); - expect(buildPhaseScript.existsSync(), isTrue); - - final String buildPhaseScriptContents = buildPhaseScript.readAsStringSync(); - expect(buildPhaseScriptContents.contains(r'OTHER_LDFLAGS=$(inherited) -framework Flutter'), isTrue); - }); - - testUsingOsxContext('do not set OTHER_LDFLAGS for macOS', () async { - when(mockArtifacts.getArtifactPath(Artifact.flutterMacOSFramework, - platform: TargetPlatform.darwin_x64, - mode: anyNamed('mode'), - environmentType: anyNamed('environmentType'))) - .thenReturn(fs.path.join('engine', 'FlutterMacOS.framework')); - when(mockArtifacts.engineOutPath).thenReturn(fs.path.join('out', 'ios_profile_arm')); - - const BuildInfo buildInfo = BuildInfo(BuildMode.debug, null, treeShakeIcons: false); - final FlutterProject project = FlutterProject.fromPath('path/to/project'); - await updateGeneratedXcodeProperties( - project: project, - buildInfo: buildInfo, - useMacOSConfig: true, - ); - - final File config = fs.file('path/to/project/macos/Flutter/ephemeral/Flutter-Generated.xcconfig'); - expect(config.existsSync(), isTrue); - - final String contents = config.readAsStringSync(); - expect(contents.contains('OTHER_LDFLAGS'), isFalse); - - final File buildPhaseScript = fs.file('path/to/project/macos/Flutter/ephemeral/flutter_export_environment.sh'); - expect(buildPhaseScript.existsSync(), isTrue); - - final String buildPhaseScriptContents = buildPhaseScript.readAsStringSync(); - expect(buildPhaseScriptContents.contains('OTHER_LDFLAGS'), isFalse); - }); - testUsingOsxContext('sets ARCHS=armv7 when armv7 local engine is set', () async { when(mockArtifacts.getArtifactPath(Artifact.flutterFramework, platform: TargetPlatform.ios,