Skip to content

Commit

Permalink
[flutter_tools] Fix local engine preview device (flutter#138046)
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherfujino authored Nov 8, 2023
1 parent e724689 commit 8969288
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/flutter_tools/lib/src/artifacts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,12 @@ class CachedLocalEngineArtifacts implements Artifacts {
case Artifact.flutterToolsFileGenerators:
return _getFileGeneratorsPath();
case Artifact.flutterPreviewDevice:
throw UnimplementedError('The preview device is not supported with local engine builds');
return _backupCache.getArtifactPath(
artifact,
platform: platform,
mode: mode,
environmentType: environmentType,
);
}
}

Expand Down
8 changes: 8 additions & 0 deletions packages/flutter_tools/test/general.shard/artifacts_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,14 @@ void main() {
'snapshots', 'frontend_server_aot.dart.snapshot')
);

expect(
artifacts.getArtifactPath(
Artifact.flutterPreviewDevice,
platform: TargetPlatform.windows_x64,
),
fileSystem.path.join('root', 'bin', 'cache', 'artifacts',
'flutter_preview', 'flutter_preview.exe'),
);

fileSystem.file(fileSystem.path.join('/out', 'host_debug_unopt', 'impellerc'))
.createSync(recursive: true);
Expand Down

0 comments on commit 8969288

Please sign in to comment.