Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(626)

Unified Diff: pkg/analyzer/lib/src/dart/sdk/sdk.dart

Issue 2568743003: Fix analyzer's SDK detection so that during integration tests, we use the built SDK. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/sdk/sdk.dart
diff --git a/pkg/analyzer/lib/src/dart/sdk/sdk.dart b/pkg/analyzer/lib/src/dart/sdk/sdk.dart
index 303e6a49f917532b809816a197506a967fce831c..fc1a2d3c7493611163430792533bcf21a3701515 100644
--- a/pkg/analyzer/lib/src/dart/sdk/sdk.dart
+++ b/pkg/analyzer/lib/src/dart/sdk/sdk.dart
@@ -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) {
zra 2016/12/12 19:16:17 Shouldn't this be checking the existence of buildS
Paul Berry 2016/12/12 19:24:39 Yes, I just noticed this as well. Thanks.
Paul Berry 2016/12/12 19:27:50 Fix is here: https://codereview.chromium.org/25682
+ return builtSdkPath;
+ } else {
+ return sdkPath;
+ }
}
// probably be "dart-sdk/bin/dart"
return pathContext.dirname(pathContext.dirname(exec));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698