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

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 664aee520ae8387c2c1a37fc22fbc7eec6eeed81..34ad40f885239e49de62a69a0566ffb2e65809b0 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
@@ -174,6 +174,8 @@ abstract class Compiler implements DiagnosticListener {
*/
final bool preserveComments;
+ final api.CompilerOutputProvider outputProvider;
+
bool disableInlining = false;
final Tracer tracer;
@@ -299,9 +301,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);
@@ -1079,3 +1085,21 @@ bool invariant(Spannable spannable, var condition, {String message: null}) {
}
return true;
}
+
+/// A sink that drains into /dev/null.
ngeoffray 2013/01/10 12:15:21 Really?
ahe 2013/01/25 15:50:09 For all intents and purposes. If you can observe t
+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 outputProvider(String name, String extension) {
ngeoffray 2013/01/10 12:15:21 Use the typedef for the return type?
ahe 2013/01/25 15:50:09 Done.
+ return new NullSink('$name.$extension');
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698