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

Unified Diff: lib/src/compiler.dart

Issue 11275029: Support for specifying an output directory (issue #106) (Closed) Base URL: git@github.com:dart-lang/dart-web-components.git@master
Patch Set: Created 8 years, 2 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: lib/src/compiler.dart
diff --git a/lib/src/compiler.dart b/lib/src/compiler.dart
index b767208ef8d66b7e72cc832c33674afe6073993c..6742715b198de30c115a9b1435ec5addb4fe5c8e 100644
--- a/lib/src/compiler.dart
+++ b/lib/src/compiler.dart
@@ -11,12 +11,13 @@ import 'package:html5lib/parser.dart';
import 'analyzer.dart';
import 'code_printer.dart';
import 'codegen.dart' as codegen;
+import 'directive_parser.dart' show parseDartCode;
import 'emitters.dart';
-import 'messages.dart';
import 'file_system.dart';
import 'file_system/path.dart';
import 'files.dart';
import 'info.dart';
+import 'messages.dart';
import 'options.dart';
import 'utils.dart';
@@ -122,6 +123,12 @@ class Compiler {
var fileInfo = new FileInfo(dartFile.path);
info[dartFile.path] = fileInfo;
fileInfo.inlinedCode = dartFile.code;
+ fileInfo.userCode = parseDartCode(fileInfo.inlinedCode, messages);
+ if (fileInfo.userCode.partOf != null) {
+ messages.error('expected a library, not a part.', null,
+ file: dartFile.path);
+ }
+
files.add(dartFile);
}
@@ -160,7 +167,7 @@ class Compiler {
/** Emit the main .dart file. */
void _emitMainDart(SourceFile file) {
var fileInfo = info[file.path];
- var contents = new MainPageEmitter(fileInfo).run(file.document);
+ var contents = new MainPageEmitter(fileInfo).run(file.document, _pathInfo);
output.add(new OutputFile(_pathInfo.outputLibraryPath(fileInfo), contents));
}
@@ -199,7 +206,7 @@ class Compiler {
void _emitComponents(SourceFile file) {
var fileInfo = info[file.path];
for (var component in fileInfo.declaredComponents) {
- var code = new WebComponentEmitter(fileInfo).run(component);
+ var code = new WebComponentEmitter(fileInfo).run(component, _pathInfo);
output.add(new OutputFile(_pathInfo.outputLibraryPath(component), code));
}
}

Powered by Google App Engine
This is Rietveld 408576698