Unverified Commit db94472a authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Skip iOS project migration when script is already embedding frameworks (#51963)

parent dc333346
......@@ -87,7 +87,7 @@ class RemoveFrameworkLinkAndEmbeddingMigration extends IOSMigrator {
// Embed and thin frameworks in a script instead of using Xcode's link / embed build phases.
const String thinBinaryScript = 'xcode_backend.sh\\" thin';
if (line.contains(thinBinaryScript)) {
if (line.contains(thinBinaryScript) && !line.contains(' embed')) {
return line.replaceFirst(thinBinaryScript, 'xcode_backend.sh\\" embed_and_thin');
}
......
......@@ -72,6 +72,22 @@ void main () {
expect(testLogger.statusText, isEmpty);
});
testWithoutContext('skips migrating script with embed', () {
const String contents = '''
shellScript = "/bin/sh \"\$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\\" embed\\n/bin/sh \"\$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\\" thin\n";
''';
xcodeProjectInfoFile.writeAsStringSync(contents);
final RemoveFrameworkLinkAndEmbeddingMigration iosProjectMigration = RemoveFrameworkLinkAndEmbeddingMigration(
mockIosProject,
testLogger,
mockXcode,
);
expect(iosProjectMigration.migrate(), isTrue);
expect(xcodeProjectInfoFile.readAsStringSync(), contents);
expect(testLogger.statusText, isEmpty);
});
testWithoutContext('Xcode project is migrated', () {
xcodeProjectInfoFile.writeAsStringSync('''
prefix 3B80C3941E831B6300D905FE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment