| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2015, the Dartino 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:servicec/compiler.dart' as servicec; | |
| 8 import 'package:args/args.dart'; | |
| 9 | |
| 10 main(List<String> arguments) { | |
| 11 ArgParser parser = new ArgParser(); | |
| 12 parser.addOption('out', defaultsTo: "."); | |
| 13 ArgResults results = parser.parse(arguments); | |
| 14 String outputDirectory = results['out']; | |
| 15 if (!(new Directory(outputDirectory)).existsSync()) { | |
| 16 print("Output directory '$outputDirectory' does not exist."); | |
| 17 exit(1); | |
| 18 } | |
| 19 if (results.rest.isEmpty) { | |
| 20 print("No input files."); | |
| 21 exit(1); | |
| 22 } | |
| 23 for (String path in results.rest) { | |
| 24 servicec.compile(path, outputDirectory); | |
| 25 } | |
| 26 } | |
| OLD | NEW |