@@ -25,8 +25,7 @@ class Sdk {
2525
2626 factory Sdk () => _instance;
2727
28- Sdk ._(this .sdkPath, bool runFromBuildRoot)
29- : _runFromBuildRoot = runFromBuildRoot;
28+ Sdk ._(this .sdkPath, this ._runFromBuildRoot);
3029
3130 /// Path to the 'dart' executable in the Dart SDK.
3231 String get dart {
@@ -42,8 +41,9 @@ class Sdk {
4241 }
4342
4443 static Sdk _createSingleton () {
45- // Find SDK path.
46- (String , bool )? trySDKPath (String executablePath) {
44+ // Looks for certain SDK files at [executablePath], returning an [Sdk] if
45+ // found, and `null` if not.
46+ Sdk ? trySdkPath (String executablePath) {
4747 // The common case, and how cli_util.dart computes the Dart SDK directory,
4848 // [path.dirname] called twice on Platform.executable. We confirm by
4949 // asserting that the directory `./bin/snapshots/` exists in this directory:
@@ -63,20 +63,17 @@ class Sdk {
6363
6464 // Try to locate the DartDev snapshot to determine if we're able to find
6565 // the SDK snapshots with this SDK path. This is meant to handle
66- // non-standard SDK layouts that can involve symlinks (e.g., Brew
66+ // non-standard SDK layouts that can involve symlinks (e.g., Homebrew
6767 // installations, google3 tests, etc).
6868 if (! _checkArtifactExists (
69- path.join (snapshotsDir, 'dartdev .dart.snapshot' ),
69+ path.join (snapshotsDir, 'dartdev_aot .dart.snapshot' ),
7070 )) {
7171 return null ;
7272 }
73- return (sdkPath, runFromBuildRoot);
73+ return Sdk ._ (sdkPath, runFromBuildRoot);
7474 }
7575
76- var (sdkPath, runFromBuildRoot) =
77- trySDKPath (Platform .resolvedExecutable) ??
78- trySDKPath (Platform .executable)! ;
79-
80- return Sdk ._(sdkPath, runFromBuildRoot);
76+ return trySdkPath (Platform .resolvedExecutable) ??
77+ trySdkPath (Platform .executable)! ;
8178 }
8279}
0 commit comments