Skip to content

Commit d8a5e38

Browse files
authored
fix(flutter_tool): remove stale shorebird build artifacts (#68)
1 parent 4353ddb commit d8a5e38

File tree

1 file changed

+8
-2
lines changed
  • packages/flutter_tools/lib/src/build_system/targets

1 file changed

+8
-2
lines changed

packages/flutter_tools/lib/src/build_system/targets/ios.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,20 @@ abstract class AotAssemblyBase extends Target {
132132
skipMissingInputs: true,
133133
);
134134

135+
// If the shorebird directory exists, delete it first.
136+
final Directory shorebirdDir = environment.fileSystem.directory(environment.fileSystem.path.join(getIosBuildDirectory(), 'shorebird'));
137+
if (shorebirdDir.existsSync()) {
138+
shorebirdDir.deleteSync(recursive: true);
139+
}
140+
135141
// Copy the class table link information (generated by gen_snapshot) from the buildOutputPath to the iOS build directory.
136142
final File classTableLink = environment.fileSystem.file(environment.fileSystem.path.join(buildOutputPath, 'App.ct.link'));
137143
final File classTableLinkDebug = environment.fileSystem.file(environment.fileSystem.path.join(buildOutputPath, 'App.class_table.json'));
138144
if (classTableLink.existsSync()) {
139-
classTableLink.copySync(environment.fileSystem.path.join(getIosBuildDirectory(), 'shorebird', 'App.ct.link'));
145+
classTableLink.copySync(environment.fileSystem.path.join(shorebirdDir.path, 'App.ct.link'));
140146
}
141147
if (classTableLinkDebug.existsSync()) {
142-
classTableLinkDebug.copySync(environment.fileSystem.path.join(getIosBuildDirectory(), 'shorebird', 'App.class_table.json'));
148+
classTableLinkDebug.copySync(environment.fileSystem.path.join(shorebirdDir.path, 'App.class_table.json'));
143149
}
144150
}
145151
}

0 commit comments

Comments
 (0)