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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/compiler.dart

Issue 11828043: Extend compiler API to support multiple outputs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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: dart/sdk/lib/_internal/compiler/implementation/compiler.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/compiler.dart b/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
index 0137e2f2dcf8766f0aa96b2e569ce73b52d4b5f7..854e0bc0832c61a5de86446c38f431ecc718cc22 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
@@ -203,6 +203,8 @@ abstract class Compiler implements DiagnosticListener {
*/
final bool preserveComments;
+ final api.CompilerOutputProvider outputProvider;
+
bool disableInlining = false;
List<Uri> librariesToAnalyzeWhenRun;
@@ -331,9 +333,13 @@ abstract class Compiler implements DiagnosticListener {
this.rejectDeprecatedFeatures: false,
this.checkDeprecationInSdk: false,
this.preserveComments: false,
+ outputProvider,
List<String> strips: const []})
: libraries = new Map<String, LibraryElement>(),
- progress = new Stopwatch() {
+ progress = new Stopwatch(),
+ this.outputProvider =
+ (outputProvider == null) ? NullSink.outputProvider : outputProvider
+ {
progress.start();
world = new World(this);
@@ -1087,3 +1093,21 @@ bool invariant(Spannable spannable, var condition, {String message: null}) {
}
return true;
}
+
+/// A sink that drains into /dev/null.
+class NullSink extends Sink<String> {
+ final String name;
+
+ NullSink(this.name);
+
+ add(String value) {}
+
+ void close() {}
+
+ toString() => name;
+
+ /// Convenience method for getting an [api.CompilerOutputProvider].
+ static NullSink outputProvider(String name, String extension) {
+ return new NullSink('$name.$extension');
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698