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

Side by Side Diff: editor/util/plugins/com.google.dart.java2dart/resources/java_io.dart

Issue 115523004: Remove debug output and copy java_io.dart into resources. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/java_io.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 library java.io; 1 library java.io;
2 2
3 import "dart:io"; 3 import "dart:io";
4 import 'java_core.dart' show JavaIOException; 4 import 'java_core.dart' show JavaIOException;
5 import 'package:path/path.dart' as pathos; 5 import 'package:path/path.dart' as pathos;
6 6
7 class JavaSystemIO { 7 class JavaSystemIO {
8 static Map<String, String> _properties = new Map(); 8 static Map<String, String> _properties = new Map();
9 static String getProperty(String name) { 9 static String getProperty(String name) {
10 { 10 {
11 String value = _properties[name]; 11 String value = _properties[name];
12 if (value != null) { 12 if (value != null) {
13 return value; 13 return value;
14 } 14 }
15 } 15 }
16 if (name == 'os.name') { 16 if (name == 'os.name') {
17 return Platform.operatingSystem; 17 return Platform.operatingSystem;
18 } 18 }
19 if (name == 'line.separator') { 19 if (name == 'line.separator') {
20 if (Platform.isWindows) { 20 if (Platform.isWindows) {
21 return '\r\n'; 21 return '\r\n';
22 } 22 }
23 return '\n'; 23 return '\n';
24 } 24 }
25 if (name == 'com.google.dart.sdk') { 25 if (name == 'com.google.dart.sdk') {
26 String value = Platform.environment['DART_SDK'];
27 if (value != null) {
28 _properties[name] = value;
29 return value;
30 }
31 }
32 if (name == 'com.google.dart.sdk') {
33 String exec = Platform.executable; 26 String exec = Platform.executable;
34 if (exec.length != 0) { 27 if (exec.length != 0) {
35 String sdkPath; 28 String sdkPath;
36 // may be "xcodebuild/ReleaseIA32/dart" with "dart-sdk" sibling 29 // may be "xcodebuild/ReleaseIA32/dart" with "sdk" sibling
37 { 30 {
38 sdkPath = pathos.join(pathos.dirname(exec), "dart-sdk"); 31 var outDir = pathos.dirname(pathos.dirname(exec));
32 sdkPath = pathos.join(pathos.dirname(outDir), "sdk");
39 if (new Directory(sdkPath).existsSync()) { 33 if (new Directory(sdkPath).existsSync()) {
40 _properties[name] = sdkPath; 34 _properties[name] = sdkPath;
41 return sdkPath; 35 return sdkPath;
42 } 36 }
43 } 37 }
44 // probably be "dart-sdk/bin/dart" 38 // probably be "dart-sdk/bin/dart"
45 sdkPath = pathos.dirname(pathos.dirname(exec)); 39 sdkPath = pathos.dirname(pathos.dirname(exec));
46 _properties[name] = sdkPath; 40 _properties[name] = sdkPath;
47 return sdkPath; 41 return sdkPath;
48 } 42 }
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 var files = <JavaFile>[]; 117 var files = <JavaFile>[];
124 var entities = _newDirectory().listSync(); 118 var entities = _newDirectory().listSync();
125 for (FileSystemEntity entity in entities) { 119 for (FileSystemEntity entity in entities) {
126 files.add(new JavaFile(entity.path)); 120 files.add(new JavaFile(entity.path));
127 } 121 }
128 return files; 122 return files;
129 } 123 }
130 File _newFile() => new File(_path); 124 File _newFile() => new File(_path);
131 Directory _newDirectory() => new Directory(_path); 125 Directory _newDirectory() => new Directory(_path);
132 } 126 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/java_io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698