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

Unified Diff: pkg/analyzer-experimental/lib/src/generated/java_io.dart

Issue 12671003: Push new analyzer-experimental with Resolver and ResolverTest. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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: pkg/analyzer-experimental/lib/src/generated/java_io.dart
diff --git a/pkg/analyzer-experimental/lib/src/generated/java_io.dart b/pkg/analyzer-experimental/lib/src/generated/java_io.dart
index f2e1f8a781a3f9390f3bb64c8143a13d8f78681b..40e6f2d81bbc3f58821fec8e9189dd755f99a753 100644
--- a/pkg/analyzer-experimental/lib/src/generated/java_io.dart
+++ b/pkg/analyzer-experimental/lib/src/generated/java_io.dart
@@ -4,7 +4,14 @@ import "dart:io";
import "dart:uri";
class JavaSystemIO {
+ static Map<String, String> _properties = new Map();
static String getProperty(String name) {
+ {
+ String value = _properties[name];
+ if (value != null) {
+ return value;
+ }
+ }
if (name == 'os.name') {
return Platform.operatingSystem;
}
@@ -14,8 +21,21 @@ class JavaSystemIO {
}
return '\n';
}
+ if (name == 'com.google.dart.sdk') {
+ String exec = new Options().executable;
+ if (exec.length != 0) {
+ String sdkPath = new Path(exec).directoryPath.directoryPath.toString();
+ _properties[name] = sdkPath;
+ return sdkPath;
+ }
+ }
return null;
}
+ static String setProperty(String name, String value) {
+ String oldValue = _properties[name];
+ _properties[name] = value;
+ return oldValue;
+ }
static String getenv(String name) => Platform.environment[name];
}
@@ -32,7 +52,7 @@ class JavaFile {
JavaFile.fromUri(Uri uri) : this(uri.path);
int get hashCode => _path.hashCode;
bool operator ==(other) {
- return other is JavaFile && _path == other._path;
+ return other is JavaFile && other._path.toNativePath() == _path.toNativePath();
}
String getPath() => _path.toNativePath();
String getName() => _path.filename;
@@ -42,9 +62,18 @@ class JavaFile {
String getCanonicalPath() => _path.canonicalize().toNativePath();
JavaFile getAbsoluteFile() => new JavaFile(getAbsolutePath());
JavaFile getCanonicalFile() => new JavaFile(getCanonicalPath());
- bool exists() => _newFile().existsSync();
+ bool exists() {
+ if (_newFile().existsSync()) {
+ return true;
+ }
+ if (_newDirectory().existsSync()) {
+ return true;
+ }
+ return false;
+ }
Uri toURI() => new Uri.fromComponents(path: _path.toString());
String readAsStringSync() => _newFile().readAsStringSync();
int lastModified() => _newFile().lastModifiedSync().millisecondsSinceEpoch;
File _newFile() => new File.fromPath(_path);
+ Directory _newDirectory() => new Directory.fromPath(_path);
}
« no previous file with comments | « pkg/analyzer-experimental/lib/src/generated/java_core.dart ('k') | pkg/analyzer-experimental/lib/src/generated/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698