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

Unified Diff: lib/dwc_shared.dart

Issue 11092092: Support compiling templates in the browser. 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
« no previous file with comments | « lib/dwc.dart ('k') | lib/src/template/analyzer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/dwc_shared.dart
diff --git a/lib/dwc_shared.dart b/lib/dwc_shared.dart
new file mode 100644
index 0000000000000000000000000000000000000000..c41889748aa7c7a388c013c8b3506c10c792ff90
--- /dev/null
+++ b/lib/dwc_shared.dart
@@ -0,0 +1,47 @@
+// Copyright (c) 2012, 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.
+
+/**
+ * Shared functionality used by command line and dartium dwc frontends.
+ * Once dart:io dependencies are all abstracted out into
+ * src/tempalte/file_system this file can go away and dwc.dart can be used
+ * by both command line and dartium frontends.
+ */
+library dwc_shared;
+
+import 'package:args/args.dart';
+import 'src/template/cmd_options.dart';
+import 'src/template/file_system.dart';
+import 'src/template/file_system_memory.dart';
+import 'src/template/world.dart';
+
+ArgParser commandOptions() {
+ return new ArgParser()
+ ..addFlag('verbose', help: 'Display detail info', defaultsTo: false)
+ ..addFlag('clean', help: 'Remove all generated files', defaultsTo: false)
+ ..addFlag('dump', help: 'Dump AST', defaultsTo: false)
+ ..addFlag('suppress_warnings', help: 'Warnings not displayed',
+ defaultsTo: true)
+ ..addFlag('warnings_as_errors', help: 'Warning handled as errors',
+ defaultsTo: false)
+ ..addFlag('throw_on_errors', help: 'Throw on errors encountered',
+ defaultsTo: false)
+ ..addFlag('throw_on_warnings', help: 'Throw on warnings encountered',
+ defaultsTo: false)
+ ..addFlag('no_colors', help: 'Display errors/warnings in colored text',
+ defaultsTo: true)
+ ..addFlag('help', help: 'Displays this help message', defaultsTo: false);
+}
+
+void initHtmlWorld(CmdOptions opts) {
+ var fs = new MemoryFileSystem();
+ initializeWorld(fs, opts);
+
+ // TODO(terry): Should be set by arguments. When run as a tool these aren't
+ // set when run internaly set these so we can compile CSS and catch any
+ // problems programmatically.
+ // options.throwOnErrors = true;
+ // options.throwOnFatal = true;
+ // options.useColors = commandLine ? true : false;
+}
« no previous file with comments | « lib/dwc.dart ('k') | lib/src/template/analyzer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698