mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Skip iOS project migration when script is already embedding frameworks (#51963)
This commit is contained in:
parent
dc33334675
commit
db94472aeb
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user