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

Side by Side Diff: lib/src/options.dart

Issue 1213233006: Option to disable message widget (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « lib/src/dependency_graph.dart ('k') | lib/src/testing.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /// Set of flags and options passed to the compiler 5 /// Set of flags and options passed to the compiler
6 library dev_compiler.src.options; 6 library dev_compiler.src.options;
7 7
8 import 'dart:io'; 8 import 'dart:io';
9 9
10 import 'package:args/args.dart'; 10 import 'package:args/args.dart';
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 95
96 /// Minimum log-level reported on the command-line. 96 /// Minimum log-level reported on the command-line.
97 final Level logLevel; 97 final Level logLevel;
98 98
99 /// Whether to run as a development server. 99 /// Whether to run as a development server.
100 final bool serverMode; 100 final bool serverMode;
101 101
102 /// Whether to enable hash-based caching of files. 102 /// Whether to enable hash-based caching of files.
103 final bool enableHashing; 103 final bool enableHashing;
104 104
105 /// Whether to serve the error / warning widget.
106 final bool widget;
107
105 /// Port used for the HTTP server when [serverMode] is on. 108 /// Port used for the HTTP server when [serverMode] is on.
106 final int port; 109 final int port;
107 110
108 /// Host name or address for HTTP server when [serverMode] is on. 111 /// Host name or address for HTTP server when [serverMode] is on.
109 final String host; 112 final String host;
110 113
111 /// Location for runtime files, such as `dart_runtime.js`. By default this is 114 /// Location for runtime files, such as `dart_runtime.js`. By default this is
112 /// inferred to be under `lib/runtime/` in the location of the `dev_compiler` 115 /// inferred to be under `lib/runtime/` in the location of the `dev_compiler`
113 /// package (if we can infer where that is located). 116 /// package (if we can infer where that is located).
114 final String runtimeDir; 117 final String runtimeDir;
115 118
116 CompilerOptions({this.strongOptions: const StrongModeOptions(), 119 CompilerOptions({this.strongOptions: const StrongModeOptions(),
117 this.sourceOptions: const SourceResolverOptions(), 120 this.sourceOptions: const SourceResolverOptions(),
118 this.codegenOptions: const CodegenOptions(), this.checkSdk: false, 121 this.codegenOptions: const CodegenOptions(), this.checkSdk: false,
119 this.dumpInfo: false, this.dumpInfoFile, this.useColors: true, 122 this.dumpInfo: false, this.dumpInfoFile, this.useColors: true,
120 this.help: false, this.logLevel: Level.SEVERE, this.serverMode: false, 123 this.help: false, this.logLevel: Level.SEVERE, this.serverMode: false,
121 this.enableHashing: false, this.host: 'localhost', this.port: 8080, 124 this.enableHashing: false, this.widget: true, this.host: 'localhost',
122 this.runtimeDir}); 125 this.port: 8080, this.runtimeDir});
123 } 126 }
124 127
125 /// Parses options from the command-line 128 /// Parses options from the command-line
126 CompilerOptions parseOptions(List<String> argv) { 129 CompilerOptions parseOptions(List<String> argv) {
127 ArgResults args = argParser.parse(argv); 130 ArgResults args = argParser.parse(argv);
128 bool showUsage = args['help']; 131 bool showUsage = args['help'];
129 132
130 var serverMode = args['server']; 133 var serverMode = args['server'];
131 var enableHashing = args['hashing']; 134 var enableHashing = args['hashing'];
132 if (enableHashing == null) { 135 if (enableHashing == null) {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 .toList()), 191 .toList()),
189 strongOptions: new StrongModeOptions.fromArguments(args), 192 strongOptions: new StrongModeOptions.fromArguments(args),
190 checkSdk: args['sdk-check'], 193 checkSdk: args['sdk-check'],
191 dumpInfo: dumpInfo, 194 dumpInfo: dumpInfo,
192 dumpInfoFile: args['dump-info-file'], 195 dumpInfoFile: args['dump-info-file'],
193 useColors: useColors, 196 useColors: useColors,
194 help: showUsage, 197 help: showUsage,
195 logLevel: logLevel, 198 logLevel: logLevel,
196 serverMode: serverMode, 199 serverMode: serverMode,
197 enableHashing: enableHashing, 200 enableHashing: enableHashing,
201 widget: args['widget'],
198 host: args['host'], 202 host: args['host'],
199 port: int.parse(args['port']), 203 port: int.parse(args['port']),
200 runtimeDir: runtimeDir); 204 runtimeDir: runtimeDir);
201 } 205 }
202 206
203 final ArgParser argParser = StrongModeOptions.addArguments(new ArgParser() 207 final ArgParser argParser = StrongModeOptions.addArguments(new ArgParser()
204 ..addFlag('sdk-check', 208 ..addFlag('sdk-check',
205 abbr: 's', help: 'Typecheck sdk libs', defaultsTo: false) 209 abbr: 's', help: 'Typecheck sdk libs', defaultsTo: false)
206 ..addFlag('mock-sdk', 210 ..addFlag('mock-sdk',
207 abbr: 'm', help: 'Use a mock Dart SDK', defaultsTo: false) 211 abbr: 'm', help: 'Use a mock Dart SDK', defaultsTo: false)
(...skipping 22 matching lines...) Expand all
230 ..addFlag('source-maps', 234 ..addFlag('source-maps',
231 help: 'Whether to emit source map files', defaultsTo: true) 235 help: 'Whether to emit source map files', defaultsTo: true)
232 ..addOption('runtime-dir', 236 ..addOption('runtime-dir',
233 help: 'Where to find dev_compiler\'s runtime files', defaultsTo: null) 237 help: 'Where to find dev_compiler\'s runtime files', defaultsTo: null)
234 238
235 // general options 239 // general options
236 ..addFlag('help', abbr: 'h', help: 'Display this message') 240 ..addFlag('help', abbr: 'h', help: 'Display this message')
237 ..addFlag('server', help: 'Run as a development server.', defaultsTo: false) 241 ..addFlag('server', help: 'Run as a development server.', defaultsTo: false)
238 ..addFlag('hashing', 242 ..addFlag('hashing',
239 help: 'Enable hash-based file caching.', defaultsTo: null) 243 help: 'Enable hash-based file caching.', defaultsTo: null)
244 ..addFlag('widget',
245 help: 'Serve embedded widget with static errors and warnings.',
246 defaultsTo: true)
240 ..addOption('host', 247 ..addOption('host',
241 help: 'Host name or address to serve files from, e.g. --host=0.0.0.0\n' 248 help: 'Host name or address to serve files from, e.g. --host=0.0.0.0\n'
242 'to listen on all interfaces (used only when --serve is on)', 249 'to listen on all interfaces (used only when --serve is on)',
243 defaultsTo: 'localhost') 250 defaultsTo: 'localhost')
244 ..addOption('port', 251 ..addOption('port',
245 help: 'Port to serve files from (used only when --serve is on)', 252 help: 'Port to serve files from (used only when --serve is on)',
246 defaultsTo: '8080') 253 defaultsTo: '8080')
247 ..addFlag('force-compile', 254 ..addFlag('force-compile',
248 help: 'Compile code with static errors', defaultsTo: false) 255 help: 'Compile code with static errors', defaultsTo: false)
249 ..addOption('log', abbr: 'l', help: 'Logging level (defaults to severe)') 256 ..addOption('log', abbr: 'l', help: 'Logging level (defaults to severe)')
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 // The pub-cache directory is two levels up, but we verify that the layout 304 // The pub-cache directory is two levels up, but we verify that the layout
298 // looks correct. 305 // looks correct.
299 if (path.basename(dir) != 'dev_compiler') return null; 306 if (path.basename(dir) != 'dev_compiler') return null;
300 dir = path.dirname(dir); 307 dir = path.dirname(dir);
301 if (path.basename(dir) != 'global_packages') return null; 308 if (path.basename(dir) != 'global_packages') return null;
302 dir = path.dirname(dir); 309 dir = path.dirname(dir);
303 return path.join(dir, cacheDir, 'lib', 'runtime'); 310 return path.join(dir, cacheDir, 'lib', 'runtime');
304 } 311 }
305 return null; 312 return null;
306 } 313 }
OLDNEW
« no previous file with comments | « lib/src/dependency_graph.dart ('k') | lib/src/testing.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698