Add support for LOCAL_ENGINE_HOST to Linux/Mac/Win builds. (#132579)

Partial work towards https://github.com/flutter/flutter/issues/132245.

I also couldn't help myself to do a very minor refactor and add some comments to `LocalEngineInfo` because I was getting confused myself implementing it.
This commit is contained in:
Matan Lurey
2023-08-16 15:24:51 -07:00
committed by GitHub
parent 14f9ed28d0
commit 223ae5d3ac
8 changed files with 127 additions and 54 deletions

View File

@@ -56,9 +56,11 @@ Future<void> buildLinux(
environmentConfig['FLUTTER_TARGET'] = target;
final LocalEngineInfo? localEngineInfo = globals.artifacts?.localEngineInfo;
if (localEngineInfo != null) {
final String engineOutPath = localEngineInfo.engineOutPath;
environmentConfig['FLUTTER_ENGINE'] = globals.fs.path.dirname(globals.fs.path.dirname(engineOutPath));
environmentConfig['LOCAL_ENGINE'] = localEngineInfo.localEngineName;
final String targetOutPath = localEngineInfo.targetOutPath;
// $ENGINE/src/out/foo_bar_baz -> $ENGINE/src
environmentConfig['FLUTTER_ENGINE'] = globals.fs.path.dirname(globals.fs.path.dirname(targetOutPath));
environmentConfig['LOCAL_ENGINE'] = localEngineInfo.localTargetName;
environmentConfig['LOCAL_ENGINE_HOST'] = localEngineInfo.localHostName;
}
writeGeneratedCmakeConfig(Cache.flutterRoot!, linuxProject, buildInfo, environmentConfig, logger);