Skip to content

Commit 2d17299

Browse files
Use the in-tree engine by default when using --local-engine or --local-web-sdk (#161110)
Now that we're in a monorepo, it makes sense to use the in-tree engine by default when using `--local-engine` or `--local-web-sdk` rather than looking for a sibling directory like we used to.
1 parent dbf9e32 commit 2d17299

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

packages/flutter_tools/lib/src/runner/local_engine.dart

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,9 @@ import '../dart/package_map.dart';
1818
/// The flutter tool can be run with the output files of one or more engine builds
1919
/// replacing the cached artifacts. Typically this is done by setting the
2020
/// `--local-engine` command line flag to the name of the desired engine variant
21-
/// (e.g. "host_debug_unopt"). Provided that the `flutter/` and `engine/` directories
22-
/// are located adjacent to one another, the output folder will be located
23-
/// automatically.
24-
///
25-
/// For scenarios where the engine is not adjacent to flutter, the
26-
/// `--local-engine-src-path` can be provided to give an exact path.
21+
/// (e.g. "host_debug_unopt"). The `--local-engine-src-path` can be provided to
22+
/// give an exact path to the engine subtree. If it is not specified, the `engine`
23+
/// subfolder in this repository is used.
2724
///
2825
/// For more information on local engines, see README.md.
2926
class LocalEngineLocator {
@@ -77,7 +74,7 @@ class LocalEngineLocator {
7774

7875
// If engineSourcePath is still not set, try to determine it by flutter root.
7976
engineSourcePath ??= _tryEnginePath(
80-
_fileSystem.path.join(_fileSystem.directory(_flutterRoot).parent.path, 'engine', 'src'),
77+
_fileSystem.path.join(_fileSystem.directory(_flutterRoot).path, 'engine', 'src'),
8178
);
8279
}
8380

packages/flutter_tools/test/general.shard/runner/local_engine_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import 'package:flutter_tools/src/runner/local_engine.dart';
1212

1313
import '../../src/common.dart';
1414

15-
const String kEngineRoot = '/flutter/engine';
15+
const String kEngineRoot = '/flutter/flutter/engine';
1616
const String kArbitraryEngineRoot = '/arbitrary/engine';
1717
const String kPackageConfig = '.dart_tool/package_config.json';
1818

@@ -372,11 +372,11 @@ void main() {
372372
localHostEngine: 'host_debug',
373373
),
374374
matchesEngineBuildPaths(
375-
hostEngine: 'flutter/engine/src/out/host_debug',
376-
targetEngine: 'flutter/engine/src/out/ios_debug',
375+
hostEngine: 'flutter/flutter/engine/src/out/host_debug',
376+
targetEngine: 'flutter/flutter/engine/src/out/ios_debug',
377377
),
378378
);
379-
expect(logger.traceText, contains('Local engine source at flutter/engine/src'));
379+
expect(logger.traceText, contains('Local engine source at flutter/flutter/engine/src'));
380380
});
381381

382382
testWithoutContext('fails if --local-engine is specified and --local-engine-src-path '

0 commit comments

Comments
 (0)