Files
sdk/pkg/dev_compiler/bin/devc.dart
T
Sigmund Cherem 6d9564b4ff Support browser caching using hashes in serverMode (fixes #93, fixes #92).
Now the HTML can include a hash in the URL for cachable resources, and the serve knows how to include cache-control headers.

In the process of doing so, I had to change a couple things that made it possible to fix #92 as well (producing different output in the command-line than in server mode).

R=vsm@google.com

Review URL: https://codereview.chromium.org/993213003
2015-03-10 18:27:23 -07:00

46 lines
1.2 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.
/// Command line tool to run the checker on a Dart program.
library dev_compiler.bin.checker;
import 'dart:io';
import 'package:dev_compiler/devc.dart';
import 'package:dev_compiler/src/options.dart';
void _showUsageAndExit() {
print('usage: dartdevc [<options>] <file.dart>\n');
print('<file.dart> is a single Dart file to process.\n');
print('<options> include:\n');
print(argParser.usage);
exit(1);
}
void main(List<String> args) {
var options = parseOptions(args);
if (options.help) _showUsageAndExit();
if (!options.useMockSdk && options.dartSdkPath == null) {
print('Could not automatically find dart sdk path.');
print('Please pass in explicitly: --dart-sdk <path>');
exit(1);
}
if (options.entryPointFile == null) {
print('Expected filename.');
_showUsageAndExit();
}
setupLogger(options.logLevel, print);
if (options.serverMode) {
new CompilerServer(options).start();
} else {
var result = new Compiler(options).run();
exit(result.failure ? 1 : 0);
}
}