| OLD | NEW |
| 1 library java.io; | 1 library java.io; |
| 2 | 2 |
| 3 import "dart:io"; | 3 import "dart:io"; |
| 4 | 4 |
| 5 class JavaSystemIO { | 5 class JavaSystemIO { |
| 6 static Map<String, String> _properties = new Map(); | 6 static Map<String, String> _properties = new Map(); |
| 7 static String getProperty(String name) { | 7 static String getProperty(String name) { |
| 8 { | 8 { |
| 9 String value = _properties[name]; | 9 String value = _properties[name]; |
| 10 if (value != null) { | 10 if (value != null) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 return '\n'; | 21 return '\n'; |
| 22 } | 22 } |
| 23 if (name == 'com.google.dart.sdk') { | 23 if (name == 'com.google.dart.sdk') { |
| 24 String value = Platform.environment['DART_SDK']; | 24 String value = Platform.environment['DART_SDK']; |
| 25 if (value != null) { | 25 if (value != null) { |
| 26 _properties[name] = value; | 26 _properties[name] = value; |
| 27 return value; | 27 return value; |
| 28 } | 28 } |
| 29 } | 29 } |
| 30 if (name == 'com.google.dart.sdk') { | 30 if (name == 'com.google.dart.sdk') { |
| 31 String exec = new Options().executable; | 31 String exec = Platform.executable; |
| 32 if (exec.length != 0) { | 32 if (exec.length != 0) { |
| 33 String sdkPath; | 33 String sdkPath; |
| 34 // may be "xcodebuild/ReleaseIA32/dart" with "dart-sdk" sibling | 34 // may be "xcodebuild/ReleaseIA32/dart" with "dart-sdk" sibling |
| 35 { | 35 { |
| 36 sdkPath = new Path(exec).directoryPath.append("dart-sdk").toNativePath
(); | 36 sdkPath = new Path(exec).directoryPath.append("dart-sdk").toNativePath
(); |
| 37 if (new Directory(sdkPath).existsSync()) { | 37 if (new Directory(sdkPath).existsSync()) { |
| 38 _properties[name] = sdkPath; | 38 _properties[name] = sdkPath; |
| 39 return sdkPath; | 39 return sdkPath; |
| 40 } | 40 } |
| 41 } | 41 } |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 List<JavaFile> files = []; | 110 List<JavaFile> files = []; |
| 111 List<FileSystemEntity> entities = _newDirectory().listSync(); | 111 List<FileSystemEntity> entities = _newDirectory().listSync(); |
| 112 for (FileSystemEntity entity in entities) { | 112 for (FileSystemEntity entity in entities) { |
| 113 files.add(new JavaFile(entity.path)); | 113 files.add(new JavaFile(entity.path)); |
| 114 } | 114 } |
| 115 return files; | 115 return files; |
| 116 } | 116 } |
| 117 File _newFile() => new File.fromPath(_path); | 117 File _newFile() => new File.fromPath(_path); |
| 118 Directory _newDirectory() => new Directory.fromPath(_path); | 118 Directory _newDirectory() => new Directory.fromPath(_path); |
| 119 } | 119 } |
| OLD | NEW |