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

Side by Side Diff: bin/devc.dart

Issue 1174643003: expose strong checker API, for use by analyzer_cli (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | bin/edit_files.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env dart 1 #!/usr/bin/env dart
2 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 2 // Copyright (c) 2015, 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 /// Command line tool to run the checker on a Dart program. 6 /// Command line tool to run the checker on a Dart program.
7 library dev_compiler.bin.checker; 7 library dev_compiler.bin.checker;
8 8
9 import 'dart:io'; 9 import 'dart:io';
10 10
11 import 'package:dev_compiler/devc.dart'; 11 import 'package:dev_compiler/devc.dart';
12 import 'package:dev_compiler/src/options.dart'; 12 import 'package:dev_compiler/src/options.dart';
13 13
14 void _showUsageAndExit() { 14 void _showUsageAndExit() {
15 print('usage: dartdevc [<options>] <file.dart>\n'); 15 print('usage: dartdevc [<options>] <file.dart>\n');
16 print('<file.dart> is a single Dart file to process.\n'); 16 print('<file.dart> is a single Dart file to process.\n');
17 print('<options> include:\n'); 17 print('<options> include:\n');
18 print(argParser.usage); 18 print(argParser.usage);
19 exit(1); 19 exit(1);
20 } 20 }
21 21
22 void main(List<String> args) { 22 void main(List<String> args) {
23 var options = parseOptions(args); 23 var options = parseOptions(args);
24 if (options.help) _showUsageAndExit(); 24 if (options.help) _showUsageAndExit();
25 25
26 if (!options.useMockSdk && options.dartSdkPath == null) { 26 var srcOpts = options.sourceOptions;
27 if (!srcOpts.useMockSdk && srcOpts.dartSdkPath == null) {
27 print('Could not automatically find dart sdk path.'); 28 print('Could not automatically find dart sdk path.');
28 print('Please pass in explicitly: --dart-sdk <path>'); 29 print('Please pass in explicitly: --dart-sdk <path>');
29 exit(1); 30 exit(1);
30 } 31 }
31 32
32 if (options.entryPointFile == null) { 33 if (srcOpts.entryPointFile == null) {
33 print('Expected filename.'); 34 print('Expected filename.');
34 _showUsageAndExit(); 35 _showUsageAndExit();
35 } 36 }
36 37
37 setupLogger(options.logLevel, print); 38 setupLogger(options.logLevel, print);
38 39
39 if (options.serverMode) { 40 if (options.serverMode) {
40 new CompilerServer(options).start(); 41 new CompilerServer(options).start();
41 } else { 42 } else {
42 var result = new Compiler(options).run(); 43 var result = new Compiler(options).run();
43 exit(result.failure ? 1 : 0); 44 exit(result.failure ? 1 : 0);
44 } 45 }
45 } 46 }
OLDNEW
« no previous file with comments | « no previous file | bin/edit_files.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698