73159b6c1e
This change removes functionality that is not part of the core Dart Dev Compiler, in particular those features that were not designed for incremental/modular compilation. For a while, the primary way to use DDC will be as a compiler invoked by a build system, e.g. make or bazel or some node.js based-build system. We'd love to see the user functionality provided by these return. In particular, a well designed server+watcher system would be a huge boost to productivity! I'll see about moving over HTML reporting to Analyzer CLI. It has a lovely UI. Thanks to everyone who contributed these features. The following features were removed: * DDC transformer. Transformers require whole world, in memory files. * DDC server. The server has its own mini-build system. * Various kinds of reporting. These should be moved to Analyzer CLI. Note: batch compiler and the node runner are left for now. R=vsm@google.com Review URL: https://codereview.chromium.org/1788973002 .
47 lines
1.3 KiB
Dart
Executable File
47 lines
1.3 KiB
Dart
Executable File
#!/usr/bin/env dart
|
|
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
/// Runs dev_compiler's checker, and optionally the code generator.
|
|
/// Also can run a server for local development.
|
|
library dev_compiler.bin.dartdevc;
|
|
|
|
import 'dart:io';
|
|
|
|
import 'package:dev_compiler/devc.dart' show devCompilerVersion;
|
|
import 'package:dev_compiler/src/compiler.dart'
|
|
show validateOptions, compile, setupLogger;
|
|
import 'package:dev_compiler/src/options.dart';
|
|
|
|
const String _appName = 'dartdevc';
|
|
|
|
void _showUsageAndExit() {
|
|
print('usage: dartdevc [<options>] <file.dart>...\n');
|
|
print('<file.dart> is one or more Dart files to process.\n');
|
|
print('<options> include:\n');
|
|
print(argParser.usage);
|
|
exit(1);
|
|
}
|
|
|
|
main(List<String> args) {
|
|
var options;
|
|
|
|
try {
|
|
options = validateOptions(args);
|
|
} on FormatException catch (e) {
|
|
print('${e.message}\n');
|
|
_showUsageAndExit();
|
|
}
|
|
|
|
if (options == null || options.help) _showUsageAndExit();
|
|
if (options.version) {
|
|
print('${_appName} version ${devCompilerVersion}');
|
|
exit(0);
|
|
}
|
|
|
|
setupLogger(options.logLevel, print);
|
|
bool success = compile(options);
|
|
exit(success ? 0 : 1);
|
|
}
|