mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 15:21:54 +00:00
Fix analyzer's SDK detection so that during integration tests, we use the built SDK.
R=scheglov@google.com Review-Url: https://codereview.chromium.org/2568743003 .
This commit is contained in:
parent
a7222ac09d
commit
fb2dbfce21
|
@ -698,7 +698,16 @@ class FolderBasedDartSdk extends AbstractDartSdk {
|
|||
String outDir = pathContext.dirname(pathContext.dirname(exec));
|
||||
String sdkPath = pathContext.join(pathContext.dirname(outDir), "sdk");
|
||||
if (resourceProvider.getFolder(sdkPath).exists) {
|
||||
return sdkPath;
|
||||
// We are executing in the context of a test. sdkPath is the path to the
|
||||
// *source* files for the SDK. But we want to test using the path to the
|
||||
// *built* SDK if possible.
|
||||
String builtSdkPath =
|
||||
pathContext.join(pathContext.dirname(exec), 'dart-sdk');
|
||||
if (resourceProvider.getFolder(sdkPath).exists) {
|
||||
return builtSdkPath;
|
||||
} else {
|
||||
return sdkPath;
|
||||
}
|
||||
}
|
||||
// probably be "dart-sdk/bin/dart"
|
||||
return pathContext.dirname(pathContext.dirname(exec));
|
||||
|
|
Loading…
Reference in a new issue