Skip to content

Commit fe360a9

Browse files
author
John Messerly
committed
make "compile" command optional to address #505
1 parent 6f85eb0 commit fe360a9

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

pkg/dev_compiler/bin/dartdevc.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ Future main(List<String> args) async {
5757
Future<int> _runCommand(List<String> args,
5858
{MessageHandler messageHandler}) async {
5959
try {
60+
if (args.isEmpty || args.first != 'compile' && args.first != 'help') {
61+
// TODO(jmesserly): we should deprecate the commands. For now they are
62+
// still supported for backwards compatibility.
63+
args.insert(0, 'compile');
64+
}
6065
var runner = new CommandRunner('dartdevc', 'Dart Development Compiler');
6166
runner.addCommand(new CompileCommand(messageHandler: messageHandler));
6267
await runner.run(args);

pkg/dev_compiler/lib/src/compiler/code_generator.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5104,7 +5104,7 @@ String jsLibraryName(String buildRoot, LibraryElement library) {
51045104
uri.path.substring(buildRoot.length).replaceAll('/', separator);
51055105
} else {
51065106
// We don't have a unique name.
5107-
throw 'Invalid build root. $buildRoot does not contain ${uri.toFilePath()}';
5107+
throw 'Invalid build root. $buildRoot does not contain ${uri.toFilePath()}';
51085108
}
51095109
return pathToJSIdentifier(qualifiedPath);
51105110
}

0 commit comments

Comments
 (0)