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

Unified Diff: dart/frog/leg/frog_leg.dart

Issue 9866006: Add library mapping. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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: dart/frog/leg/frog_leg.dart
diff --git a/dart/frog/leg/frog_leg.dart b/dart/frog/leg/frog_leg.dart
index 8c1e28bcf73036a2cef800a0bfc8fc0fa3dda54d..9535057c9d40685d90e6d1a9e0dd324404990d08 100644
--- a/dart/frog/leg/frog_leg.dart
+++ b/dart/frog/leg/frog_leg.dart
@@ -4,11 +4,12 @@
#library('frog_leg');
+#import('dart:io');
+
#import('../../lib/uri/uri.dart');
#import('source_file.dart');
#import('../lang.dart', prefix: 'frog');
#import('api.dart', prefix: 'api');
-#import('io/io.dart', prefix: 'io');
String relativize(Uri base, Uri uri) {
if (base.scheme == 'file' &&
@@ -45,12 +46,12 @@ bool compile(frog.World world) {
final showWarnings = frog.options.showWarnings;
final allowMockCompilation = frog.options.allowMockCompilation;
// final compiler = new WorldCompiler(world, throwOnError);
- Uri cwd = new Uri(scheme: 'file', path: io.getCurrentDirectory());
+ Uri cwd = new Uri(scheme: 'file', path: getCurrentDirectory());
Uri uri = cwd.resolve(frog.options.dartScript);
String frogLibDir = frog.options.libDir;
if (!frogLibDir.endsWith("/")) frogLibDir = "$frogLibDir/";
Uri frogLib = new Uri(scheme: 'file', path: frogLibDir);
- Uri libraryRoot = frogLib.resolve('../leg/lib/');
+ Uri libraryRoot = frogLib.resolve('../../');
Map<String, SourceFile> sourceFiles = <SourceFile>{};
Future<String> provider(Uri uri) {
@@ -98,3 +99,9 @@ class AbortLeg {
AbortLeg(this.message);
toString() => 'Aborted due to --throw-on-error: $message';
}
+
+String getCurrentDirectory() {
ahe 2012/03/26 21:39:33 Duplicated code. This file will go away when we fu
+ String dir = new File(".").fullPathSync();
+ if (dir.endsWith("/")) return dir;
+ return "$dir/";
+}

Powered by Google App Engine
This is Rietveld 408576698