Remove manual Flutter linking for iOS projects (#71862)
This commit is contained in:
@@ -181,11 +181,6 @@ List<String> _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
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user