mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Fix host engine lookup for iOS simulator builds (#14304)
When running with --preview-dart-2, host variant of the engine is required. Simulator builds, like device builds, should resolve host_RUNTIMEVARIANT_OPTVARIANT, not host_RUNTIMEVARIANT_sim_OPTVARIANT.
This commit is contained in:
parent
d6f006db1e
commit
6854e81bdb
@ -342,10 +342,12 @@ class FlutterCommandRunner extends CommandRunner<Null> {
|
||||
throwToolExit('No Flutter engine build found at $engineBuildPath.', exitCode: 2);
|
||||
}
|
||||
|
||||
// Determine the host engine directory associated with the local engine:
|
||||
// * strip '_sim_' since there are no host simulator builds.
|
||||
// * replace the target platform with host.
|
||||
final String basename = fs.path.basename(engineBuildPath);
|
||||
final String engineHostBuildPath = fs.path.normalize(fs.path.join(
|
||||
fs.path.dirname(engineBuildPath),
|
||||
'host_' + basename.substring(basename.indexOf('_') + 1)));
|
||||
final String hostBasename = 'host_' + basename.replaceFirst('_sim_', '_').substring(basename.indexOf('_') + 1);
|
||||
final String engineHostBuildPath = fs.path.normalize(fs.path.join(fs.path.dirname(engineBuildPath), hostBasename));
|
||||
|
||||
return new EngineBuildPaths(targetEngine: engineBuildPath, hostEngine: engineHostBuildPath);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user