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

Unified Diff: sdk/lib/_internal/pub/lib/src/io.dart

Issue 200323008: Load the transformer isolate code from pub's asset directory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: extraneous field Created 6 years, 9 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: sdk/lib/_internal/pub/lib/src/io.dart
diff --git a/sdk/lib/_internal/pub/lib/src/io.dart b/sdk/lib/_internal/pub/lib/src/io.dart
index e05713dbbaa1038d020f80d026a70a8bc2f1d745..dd046f5570aa8944aaa9f314096f3c223c832ab7 100644
--- a/sdk/lib/_internal/pub/lib/src/io.dart
+++ b/sdk/lib/_internal/pub/lib/src/io.dart
@@ -401,13 +401,16 @@ bool get runningFromSdk => Platform.script.path.endsWith('.snapshot');
String resourcePath(String target) {
if (runningFromSdk) {
return path.join(
- sdk.rootDirectory, 'lib', '_internal', 'pub', 'resource', target);
+ sdk.rootDirectory, 'lib', '_internal', 'pub', 'asset', target);
} else {
return path.join(
- path.dirname(libraryPath('pub.io')), '..', '..', 'resource', target);
+ path.dirname(libraryPath('pub.io')), '..', '..', 'asset', target);
}
}
+/// Reads a text file from pub's `resource` directory.
+String readResource(String target) => readTextFile(resourcePath(target));
Bob Nystrom 2014/03/17 21:16:07 Ditto.
nweiz 2014/03/17 22:20:40 Done.
+
/// Returns the path to the root of the Dart repository. This will throw a
/// [StateError] if it's called when running pub from the SDK.
String get repoRoot {

Powered by Google App Engine
This is Rietveld 408576698