Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Unified Diff: sdk/lib/_internal/pub/lib/src/dart.dart

Issue 133843006: Support configuring dart2js from the pubspec. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code reivew Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/pub/lib/src/dart.dart
diff --git a/sdk/lib/_internal/pub/lib/src/dart.dart b/sdk/lib/_internal/pub/lib/src/dart.dart
index 68332829bfee4726fb9f0ef021069f94b0fb1b16..af2c409263a6ae267ad32ef6d0e2ee780bb42597 100644
--- a/sdk/lib/_internal/pub/lib/src/dart.dart
+++ b/sdk/lib/_internal/pub/lib/src/dart.dart
@@ -50,16 +50,41 @@ abstract class CompilerProvider {
/// By default, the package root is assumed to be adjacent to [entrypoint], but
/// if [packageRoot] is passed that will be used instead.
Future compile(String entrypoint, CompilerProvider provider, {
- String packageRoot, bool toDart: false, bool minify: true}) {
+ Iterable<String> commandLineOptions,
+ bool checked: false,
+ bool minify: true,
+ bool verbose: false,
+ Map<String, String> environment,
+ String packageRoot,
+ bool analyzeAll: false,
+ bool suppressWarnings: false,
+ bool suppressHints: false,
+ bool terse: false,
+ bool toDart: false}) {
return syncFuture(() {
var options = <String>['--categories=Client,Server'];
- if (toDart) options.add('--output-type=dart');
+ if (checked) options.add('--checked');
if (minify) options.add('--minify');
+ if (verbose) options.add('--verbose');
+ if (analyzeAll) options.add('--analyze-all');
+ if (suppressWarnings) options.add('--suppress-warnings');
+ if (suppressHints) options.add('--suppress-hints');
+ if (terse) options.add('--terse');
+ if (toDart) options.add('--output-type=dart');
+
+ if (environment != null) {
+ environment.forEach((name, value) {
+ options.add('-D$name=$value');
+ });
+ }
+
+ if (commandLineOptions != null) options.addAll(commandLineOptions);
if (packageRoot == null) {
packageRoot = path.join(path.dirname(entrypoint), 'packages');
}
+ options.add('--asdfsadfsadf');
blois 2014/01/22 00:05:41 What does this option do?
nweiz 2014/01/28 21:09:52 Leftover from debugging.
return Chain.track(compiler.compile(
path.toUri(entrypoint),
path.toUri(appendSlash(_libPath)),
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/barback/load_transformers.dart ('k') | sdk/lib/_internal/pub/lib/src/pubspec.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698