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

Side by Side Diff: pkg/polymer/lib/dwc.dart

Issue 23898009: Switch polymer's build.dart to use the new linter. This CL does the following (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: addressing john comments (part 2) - renamed files Created 7 years, 3 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 | « pkg/polymer/lib/deploy.dart ('k') | pkg/polymer/lib/polymer_element.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
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.
4
5 /** The entry point to the compiler. Used to implement `bin/dwc.dart`. */
6 library dwc;
7
8 import 'dart:async';
9 import 'dart:io';
10 import 'package:logging/logging.dart' show Level;
11
12 import 'src/compiler.dart';
13 import 'src/file_system/console.dart';
14 import 'src/messages.dart';
15 import 'src/compiler_options.dart';
16 import 'src/utils.dart';
17
18 void main() {
19 run(new Options().arguments).then((result) {
20 exit(result.success ? 0 : 1);
21 });
22 }
23
24 /** Contains the result of a compiler run. */
25 class AnalysisResults {
26
27 /** False when errors were found by our polymer analyzer. */
28 final bool success;
29
30 /** Error and warning messages collected by the analyzer. */
31 final List<String> messages;
32
33 AnalysisResults(this.success, this.messages);
34 }
35
36 /**
37 * Runs the polymer analyzer with the command-line options in [args].
38 * See [CompilerOptions] for the definition of valid arguments.
39 */
40 // TODO(sigmund): rename to analyze? and rename file as analyzer.dart
41 Future<AnalysisResults> run(List<String> args, {bool printTime,
42 bool shouldPrint: true}) {
43 var options = CompilerOptions.parse(args);
44 if (options == null) return new Future.value(new AnalysisResults(true, []));
45 if (printTime == null) printTime = options.verbose;
46
47 return asyncTime('Total time spent on ${options.inputFile}', () {
48 var messages = new Messages(options: options, shouldPrint: shouldPrint);
49 var compiler = new Compiler(new ConsoleFileSystem(), options, messages);
50 return compiler.run().then((_) {
51 var success = messages.messages.every((m) => m.level != Level.SEVERE);
52 var msgs = options.jsonFormat
53 ? messages.messages.map((m) => m.toJson())
54 : messages.messages.map((m) => m.toString());
55 return new AnalysisResults(success, msgs.toList());
56 });
57 }, printTime: printTime, useColors: options.useColors);
58 }
OLDNEW
« no previous file with comments | « pkg/polymer/lib/deploy.dart ('k') | pkg/polymer/lib/polymer_element.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698