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

Side by Side Diff: pkg/analyzer/lib/src/generated/java_io.dart

Issue 119323009: Attempt to fix VM build. (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 | no next file » | 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 // print('getProperty[$name].1: $value');
12 if (value != null) { 13 if (value != null) {
13 return value; 14 return value;
14 } 15 }
15 } 16 }
16 if (name == 'os.name') { 17 if (name == 'os.name') {
17 return Platform.operatingSystem; 18 return Platform.operatingSystem;
18 } 19 }
19 if (name == 'line.separator') { 20 if (name == 'line.separator') {
20 if (Platform.isWindows) { 21 if (Platform.isWindows) {
21 return '\r\n'; 22 return '\r\n';
22 } 23 }
23 return '\n'; 24 return '\n';
24 } 25 }
25 if (name == 'com.google.dart.sdk') { 26 if (name == 'com.google.dart.sdk') {
26 String value = Platform.environment['DART_SDK']; 27 String value = Platform.environment['DART_SDK'];
27 if (value != null) { 28 print(Platform.environment);
28 _properties[name] = value; 29 print('current: ${pathos.current}');
29 return value; 30 print('exec: ${Platform.executable}');
30 } 31 print('execDir: ${pathos.dirname(Platform.executable)}');
32 print('getProperty[$name].2: $value');
33 // throw "";
34 // if (value != null) {
35 // _properties[name] = value;
36 // return value;
37 // }
31 } 38 }
32 if (name == 'com.google.dart.sdk') { 39 if (name == 'com.google.dart.sdk') {
33 String exec = Platform.executable; 40 String exec = Platform.executable;
34 if (exec.length != 0) { 41 if (exec.length != 0) {
35 String sdkPath; 42 String sdkPath;
36 // may be "xcodebuild/ReleaseIA32/dart" with "dart-sdk" sibling 43 // may be "xcodebuild/ReleaseIA32/dart" with "sdk" sibling
37 { 44 {
38 sdkPath = pathos.join(pathos.dirname(exec), "dart-sdk"); 45 var outDir = pathos.dirname(pathos.dirname(exec));
46 sdkPath = pathos.join(pathos.dirname(outDir), "sdk");
39 if (new Directory(sdkPath).existsSync()) { 47 if (new Directory(sdkPath).existsSync()) {
40 _properties[name] = sdkPath; 48 _properties[name] = sdkPath;
49 print('sdkPath.2: $sdkPath');
41 return sdkPath; 50 return sdkPath;
42 } 51 }
43 } 52 }
44 // probably be "dart-sdk/bin/dart" 53 // probably be "dart-sdk/bin/dart"
45 sdkPath = pathos.dirname(pathos.dirname(exec)); 54 sdkPath = pathos.dirname(pathos.dirname(exec));
55 print('sdkPath.3: $sdkPath');
46 _properties[name] = sdkPath; 56 _properties[name] = sdkPath;
47 return sdkPath; 57 return sdkPath;
48 } 58 }
49 } 59 }
50 return null; 60 return null;
51 } 61 }
52 static String setProperty(String name, String value) { 62 static String setProperty(String name, String value) {
53 String oldValue = _properties[name]; 63 String oldValue = _properties[name];
54 _properties[name] = value; 64 _properties[name] = value;
55 return oldValue; 65 return oldValue;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 var files = <JavaFile>[]; 133 var files = <JavaFile>[];
124 var entities = _newDirectory().listSync(); 134 var entities = _newDirectory().listSync();
125 for (FileSystemEntity entity in entities) { 135 for (FileSystemEntity entity in entities) {
126 files.add(new JavaFile(entity.path)); 136 files.add(new JavaFile(entity.path));
127 } 137 }
128 return files; 138 return files;
129 } 139 }
130 File _newFile() => new File(_path); 140 File _newFile() => new File(_path);
131 Directory _newDirectory() => new Directory(_path); 141 Directory _newDirectory() => new Directory(_path);
132 } 142 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698