OLD | NEW |
| (Empty) |
1 // Copyright (c) 2016, 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 import 'dart:io'; | |
6 | |
7 import 'package:args/args.dart'; | |
8 import 'package:compiler/src/filenames.dart'; | |
9 | |
10 import 'package:compiler/src/dart2js_resolver.dart'; | |
11 | |
12 main(var argv) async { | |
13 var parser = new ArgParser(); | |
14 parser.addOption('deps', abbr: 'd', allowMultiple: true); | |
15 parser.addOption('out', abbr: 'o'); | |
16 parser.addOption('library-root', abbr: 'l'); | |
17 parser.addOption('packages', abbr: 'p'); | |
18 parser.addOption('bazel-paths', abbr: 'I', allowMultiple: true); | |
19 var args = parser.parse(argv); | |
20 | |
21 if (args.rest.isEmpty) { | |
22 print('missing input files'); | |
23 exit(1); | |
24 } | |
25 | |
26 var inputs = args.rest | |
27 .map((uri) => currentDirectory.resolve(nativeToUriPath(uri))) | |
28 .toList(); | |
29 | |
30 var text = await resolve(inputs, | |
31 deps: args['deps'], | |
32 root: args['library-root'], | |
33 packages: args['packages'], | |
34 bazelSearchPaths: args['bazel-paths']); | |
35 | |
36 var outFile = args['out'] ?? 'out.data'; | |
37 | |
38 await new File(outFile).writeAsString(text); | |
39 } | |
OLD | NEW |