[flutter_tools] Fix local engine preview device (#138046)

Fixes https://github.com/flutter/flutter/issues/137982
This commit is contained in:
Christopher Fujino
2023-11-07 17:53:22 -08:00
committed by GitHub
parent e7246898b0
commit 89692884a1
2 changed files with 14 additions and 1 deletions

View File

@@ -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,
);
}
}

View File

@@ -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);