| 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 /** | 5 /** |
| 6 * Definitions used to run the polymer linter and deploy tools without using | 6 * Definitions used to run the polymer linter and deploy tools without using |
| 7 * pub serve or pub deploy. | 7 * pub serve or pub deploy. |
| 8 */ | 8 */ |
| 9 library polymer.src.build.runner; | 9 library polymer.src.build.runner; |
| 10 | 10 |
| 11 import 'dart:async'; | 11 import 'dart:async'; |
| 12 import 'dart:convert'; | 12 import 'dart:convert'; |
| 13 import 'dart:io'; | 13 import 'dart:io'; |
| 14 | 14 |
| 15 import 'package:args/args.dart'; | |
| 16 import 'package:barback/barback.dart'; | 15 import 'package:barback/barback.dart'; |
| 17 import 'package:path/path.dart' as path; | 16 import 'package:path/path.dart' as path; |
| 18 import 'package:stack_trace/stack_trace.dart'; | 17 import 'package:stack_trace/stack_trace.dart'; |
| 19 import 'package:yaml/yaml.dart'; | 18 import 'package:yaml/yaml.dart'; |
| 20 | 19 |
| 21 | 20 |
| 22 /** Collects different parameters needed to configure and run barback. */ | 21 /** Collects different parameters needed to configure and run barback. */ |
| 23 class BarbackOptions { | 22 class BarbackOptions { |
| 24 /** Phases of transformers to run. */ | 23 /** Phases of transformers to run. */ |
| 25 final List<List<Transformer>> phases; | 24 final List<List<Transformer>> phases; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 39 /** Whether to apply transformers on polymer dependencies. */ | 38 /** Whether to apply transformers on polymer dependencies. */ |
| 40 final bool transformPolymerDependencies; | 39 final bool transformPolymerDependencies; |
| 41 | 40 |
| 42 /** Directory where to generate code, if any. */ | 41 /** Directory where to generate code, if any. */ |
| 43 final String outDir; | 42 final String outDir; |
| 44 | 43 |
| 45 /** | 44 /** |
| 46 * Whether to print error messages using a json-format that tools, such as the | 45 * Whether to print error messages using a json-format that tools, such as the |
| 47 * Dart Editor, can process. | 46 * Dart Editor, can process. |
| 48 */ | 47 */ |
| 49 final String machineFormat; | 48 final bool machineFormat; |
| 50 | 49 |
| 51 BarbackOptions(this.phases, this.outDir, {currentPackage, packageDirs, | 50 BarbackOptions(this.phases, this.outDir, {currentPackage, packageDirs, |
| 52 this.transformTests: false, this.transformPolymerDependencies: false, | 51 this.transformTests: false, this.transformPolymerDependencies: false, |
| 53 this.machineFormat: false}) | 52 this.machineFormat: false}) |
| 54 : currentPackage = (currentPackage != null | 53 : currentPackage = (currentPackage != null |
| 55 ? currentPackage : readCurrentPackageFromPubspec()), | 54 ? currentPackage : readCurrentPackageFromPubspec()), |
| 56 packageDirs = (packageDirs != null | 55 packageDirs = (packageDirs != null |
| 57 ? packageDirs : _readPackageDirsFromPub(currentPackage)); | 56 ? packageDirs : _readPackageDirsFromPub(currentPackage)); |
| 58 | 57 |
| 59 } | 58 } |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 output.write(entry.span.getLocationMessage(entry.message, | 369 output.write(entry.span.getLocationMessage(entry.message, |
| 371 useColors: useColors, | 370 useColors: useColors, |
| 372 color: levelColor)); | 371 color: levelColor)); |
| 373 } | 372 } |
| 374 return output.toString(); | 373 return output.toString(); |
| 375 } | 374 } |
| 376 | 375 |
| 377 const String _RED_COLOR = '\u001b[31m'; | 376 const String _RED_COLOR = '\u001b[31m'; |
| 378 const String _MAGENTA_COLOR = '\u001b[35m'; | 377 const String _MAGENTA_COLOR = '\u001b[35m'; |
| 379 const String _NO_COLOR = '\u001b[0m'; | 378 const String _NO_COLOR = '\u001b[0m'; |
| OLD | NEW |