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

Unified Diff: utils/pub/sdk_source.dart

Issue 10689169: Use environment variables to find the Dart SDK and the Pub cache directory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 months 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
Index: utils/pub/sdk_source.dart
diff --git a/utils/pub/sdk_source.dart b/utils/pub/sdk_source.dart
index 3662f853fa4530280307cbfe9e5b2369fb43aa6c..54fa218c231f7ca6351467e33c61b12c906635eb 100644
--- a/utils/pub/sdk_source.dart
+++ b/utils/pub/sdk_source.dart
@@ -22,9 +22,15 @@ class SdkSource extends Source {
/**
* The root directory of the Dart SDK.
*/
- final String rootDir;
+ final String _rootDir;
- SdkSource(this.rootDir);
+ String get rootDir() {
+ if (_rootDir != null) return _rootDir;
+ throw "Pub can't find the Dart SDK. Please set the DART_SDK environment "
Bob Nystrom 2012/07/12 16:49:27 Instead of checking here, why not having the const
nweiz 2012/07/12 18:44:30 We want pub to work without DART_SDK if it doesn't
Bob Nystrom 2012/07/12 21:07:57 OK, cool.
+ "variable to the Dart SDK directory.";
+ }
+
+ SdkSource(this._rootDir);
/**
* An SDK package has no dependencies. Its version number is inferred from the
« utils/pub/pub.dart ('K') | « utils/pub/pub.dart ('k') | utils/tests/pub/pub_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698