OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * Common logic to make it easy to create a `build.dart` for your project. | 6 * Common logic to make it easy to create a `build.dart` for your project. |
7 * | 7 * |
8 * The `build.dart` script is invoked automatically by the Editor whenever a | 8 * The `build.dart` script is invoked automatically by the Editor whenever a |
9 * file in the project changes. It must be placed in the root of a project | 9 * file in the project changes. It must be placed in the root of a project |
10 * (where pubspec.yaml lives) and should be named exactly 'build.dart'. | 10 * (where pubspec.yaml lives) and should be named exactly 'build.dart'. |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 } | 91 } |
92 | 92 |
93 /** Handle --changed, --removed, --clean and --help command-line args. */ | 93 /** Handle --changed, --removed, --clean and --help command-line args. */ |
94 ArgResults _processArgs(List<String> arguments) { | 94 ArgResults _processArgs(List<String> arguments) { |
95 var parser = new ArgParser() | 95 var parser = new ArgParser() |
96 ..addOption("changed", help: "the file has changed since the last build", | 96 ..addOption("changed", help: "the file has changed since the last build", |
97 allowMultiple: true) | 97 allowMultiple: true) |
98 ..addOption("removed", help: "the file was removed since the last build", | 98 ..addOption("removed", help: "the file was removed since the last build", |
99 allowMultiple: true) | 99 allowMultiple: true) |
100 ..addFlag("clean", negatable: false, help: "remove any build artifacts") | 100 ..addFlag("clean", negatable: false, help: "remove any build artifacts") |
| 101 ..addFlag("machine", negatable: false, |
| 102 help: "produce warnings in a machine parseable format") |
101 ..addFlag("help", negatable: false, help: "displays this help and exit"); | 103 ..addFlag("help", negatable: false, help: "displays this help and exit"); |
102 var args = parser.parse(arguments); | 104 var args = parser.parse(arguments); |
103 if (args["help"]) { | 105 if (args["help"]) { |
104 print(parser.getUsage()); | 106 print(parser.getUsage()); |
105 exit(0); | 107 exit(0); |
106 } | 108 } |
107 return args; | 109 return args; |
108 } | 110 } |
OLD | NEW |