| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 /** | 5 /** |
| 6 * Tools for generating code in analyzer and analysis server. | 6 * Tools for generating code in analyzer and analysis server. |
| 7 */ | 7 */ |
| 8 library analyzer.src.codegen.tools; | 8 library analyzer.src.codegen.tools; |
| 9 | 9 |
| 10 import 'dart:io'; | 10 import 'dart:io'; |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 if (!target.check(pkgPath)) { | 304 if (!target.check(pkgPath)) { |
| 305 print( | 305 print( |
| 306 '${target.output(pkgPath).absolute} does not have expected contents.
'); | 306 '${target.output(pkgPath).absolute} does not have expected contents.
'); |
| 307 generateNeeded = true; | 307 generateNeeded = true; |
| 308 } | 308 } |
| 309 } | 309 } |
| 310 if (generateNeeded) { | 310 if (generateNeeded) { |
| 311 print('Please regenerate using:'); | 311 print('Please regenerate using:'); |
| 312 String executable = Platform.executable; | 312 String executable = Platform.executable; |
| 313 String packageRoot = ''; | 313 String packageRoot = ''; |
| 314 if (Platform.packageRoot.isNotEmpty) { | 314 if (Platform.packageRoot != null) { |
| 315 packageRoot = ' --package-root=${Platform.packageRoot}'; | 315 packageRoot = ' --package-root=${Platform.packageRoot}'; |
| 316 } | 316 } |
| 317 String generateScript = | 317 String generateScript = |
| 318 join(pkgPath, joinAll(posix.split(generatorRelPath))); | 318 join(pkgPath, joinAll(posix.split(generatorRelPath))); |
| 319 print(' $executable$packageRoot $generateScript'); | 319 print(' $executable$packageRoot $generateScript'); |
| 320 exit(1); | 320 exit(1); |
| 321 } else { | 321 } else { |
| 322 print('All generated files up to date.'); | 322 print('All generated files up to date.'); |
| 323 } | 323 } |
| 324 } | 324 } |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 if (lines.last.isEmpty) { | 597 if (lines.last.isEmpty) { |
| 598 lines.removeLast(); | 598 lines.removeLast(); |
| 599 buffer.add(new dom.Text(lines.join('\n$indent') + '\n')); | 599 buffer.add(new dom.Text(lines.join('\n$indent') + '\n')); |
| 600 indentNeeded = true; | 600 indentNeeded = true; |
| 601 } else { | 601 } else { |
| 602 buffer.add(new dom.Text(lines.join('\n$indent'))); | 602 buffer.add(new dom.Text(lines.join('\n$indent'))); |
| 603 indentNeeded = false; | 603 indentNeeded = false; |
| 604 } | 604 } |
| 605 } | 605 } |
| 606 } | 606 } |
| OLD | NEW |