OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 // Usage: Add the following to your .gclient file (found in the parent | 5 // Usage: Add the following to your .gclient file (found in the parent |
6 // of the "dart" in a gclient checkout of the Dart repositor). | 6 // of the "dart" in a gclient checkout of the Dart repositor). |
7 // | 7 // |
8 // hooks = [ | 8 // hooks = [ |
9 // { | 9 // { |
10 // "pattern": ".", | 10 // "pattern": ".", |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 uris.add(myLocation.resolve(DART2JS)); | 80 uris.add(myLocation.resolve(DART2JS)); |
81 uris.add(myLocation.resolve(DART2JS_MIRROR)); | 81 uris.add(myLocation.resolve(DART2JS_MIRROR)); |
82 } | 82 } |
83 | 83 |
84 // Get the names of public dart2js libraries. | 84 // Get the names of public dart2js libraries. |
85 Iterable<String> names = libraries.keys.where(isPublicDart2jsLibrary); | 85 Iterable<String> names = libraries.keys.where(isPublicDart2jsLibrary); |
86 | 86 |
87 // Prepend "dart:" to the names. | 87 // Prepend "dart:" to the names. |
88 uris.addAll(names.map((String name) => Uri.parse('dart:$name'))); | 88 uris.addAll(names.map((String name) => Uri.parse('dart:$name'))); |
89 | 89 |
90 Uri libraryRoot = myLocation.resolve(SDK_ROOT); | 90 Uri platformConfigUri = myLocation.resolve(SDK_ROOT) |
| 91 .resolve("lib/dart2js_shared_sdk"); |
91 Uri packageRoot = Uri.base.resolve(Platform.packageRoot); | 92 Uri packageRoot = Uri.base.resolve(Platform.packageRoot); |
92 | 93 |
93 analyze(uris, libraryRoot, packageRoot, handler.provider, handler) | 94 analyze(uris, platformConfigUri, packageRoot, handler.provider, handler) |
94 .then(processMirrors); | 95 .then(processMirrors); |
95 } | 96 } |
96 | 97 |
97 processMirrors(MirrorSystem mirrors) { | 98 processMirrors(MirrorSystem mirrors) { |
98 mirrors.libraries.forEach((_, LibraryMirror library) { | 99 mirrors.libraries.forEach((_, LibraryMirror library) { |
99 BackDoor.compilationUnitsOf(library).forEach(emitTagsForCompilationUnit); | 100 BackDoor.compilationUnitsOf(library).forEach(emitTagsForCompilationUnit); |
100 }); | 101 }); |
101 | 102 |
102 output.closeSync(); | 103 output.closeSync(); |
103 } | 104 } |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 | 187 |
187 return new Definition(byte_offset, line_number, tag_definition_text); | 188 return new Definition(byte_offset, line_number, tag_definition_text); |
188 } | 189 } |
189 | 190 |
190 void writeOn(StringBuffer buffer, String tagname) { | 191 void writeOn(StringBuffer buffer, String tagname) { |
191 buffer.write( | 192 buffer.write( |
192 '${tag_definition_text}\x7f${tagname}' | 193 '${tag_definition_text}\x7f${tagname}' |
193 '\x01${line_number},${byte_offset}\n'); | 194 '\x01${line_number},${byte_offset}\n'); |
194 } | 195 } |
195 } | 196 } |
OLD | NEW |