OLD | NEW |
1 #!/usr/bin/env dart | 1 #!/usr/bin/env dart |
2 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 2 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
3 // for details. All rights reserved. Use of this source code is governed by a | 3 // for details. All rights reserved. Use of this source code is governed by a |
4 // BSD-style license that can be found in the LICENSE file. | 4 // BSD-style license that can be found in the LICENSE file. |
5 | 5 |
6 /** | 6 /** |
7 * Script to compile each dart web component examples and copy the | 7 * Script to compile each dart web component examples and copy the |
8 * generated code to an output directory. | 8 * generated code to an output directory. |
9 */ | 9 */ |
10 library build_examples; | 10 library build_examples; |
11 | 11 |
12 import 'dart:io'; | 12 import 'dart:io'; |
13 import 'package:args/args.dart'; | 13 import 'package:args/args.dart'; |
14 import 'package:web_components/dwc.dart' as dwc; | 14 import 'package:web_ui/dwc.dart' as dwc; |
15 | 15 |
16 main() { | 16 main() { |
17 var argParser = new ArgParser(); | 17 var argParser = new ArgParser(); |
18 argParser.addOption('out', abbr: 'o', | 18 argParser.addOption('out', abbr: 'o', |
19 help: 'output directory for the generated code', | 19 help: 'output directory for the generated code', |
20 defaultsTo: 'generated'); | 20 defaultsTo: 'generated'); |
21 var args = argParser.parse(new Options().arguments); | 21 var args = argParser.parse(new Options().arguments); |
22 | 22 |
23 var output = args['out']; | 23 var output = args['out']; |
24 if (args.rest.isEmpty) { | 24 if (args.rest.isEmpty) { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 final String NO_COLOR = '\u001b[0m'; | 81 final String NO_COLOR = '\u001b[0m'; |
82 | 82 |
83 Stopwatch startTime() => new Stopwatch()..start(); | 83 Stopwatch startTime() => new Stopwatch()..start(); |
84 | 84 |
85 void stopTime(Stopwatch watch, String message) { | 85 void stopTime(Stopwatch watch, String message) { |
86 watch.stop(); | 86 watch.stop(); |
87 var duration = watch.elapsedMilliseconds; | 87 var duration = watch.elapsedMilliseconds; |
88 print('$message: $GREEN_COLOR$duration ms$NO_COLOR'); | 88 print('$message: $GREEN_COLOR$duration ms$NO_COLOR'); |
89 totalTime.add('$message: $GREEN_COLOR$duration ms$NO_COLOR'); | 89 totalTime.add('$message: $GREEN_COLOR$duration ms$NO_COLOR'); |
90 } | 90 } |
OLD | NEW |