Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/flutter_tools/lib/src/resident_runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,16 @@ abstract class ResidentRunner {
if (!artifactDirectory.existsSync()) {
artifactDirectory.createSync(recursive: true);
}
// TODO(jonahwilliams): this is a temporary work around to regain some of
// the initialize from dill performance. Longer term, we should have a
// better way to determine where the appropriate dill file is, as this
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an issue filed for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filled #40388

// doesn't work for Android or macOS builds.}
if (dillOutputPath == null) {
final File existingDill = fs.file(fs.path.join('build', 'app.dill'));
if (existingDill.existsSync()) {
existingDill.copySync(fs.path.join(artifactDirectory.path, 'app.dill'));
}
}
}

@protected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ void main() {

setUp(() {
testbed = Testbed(setup: () {
fs.file(fs.path.join('build', 'app.dill'))
..createSync(recursive: true)
..writeAsStringSync('ABC');
residentRunner = HotRunner(
<FlutterDevice>[
mockFlutterDevice,
Expand Down Expand Up @@ -193,6 +196,10 @@ void main() {
Usage: () => MockUsage(),
}));

test('ResidentRunner copies dill file from build output into temp directory', () => testbed.run(() async {
expect(residentRunner.artifactDirectory.childFile('app.dill').readAsStringSync(), 'ABC');
}));

test('ResidentRunner can send target platform to analytics from hot reload', () => testbed.run(() async {
when(mockDevice.sdkNameAndVersion).thenAnswer((Invocation invocation) async {
return 'Example';
Expand Down