@@ -151,6 +151,9 @@ class CompilerOptions implements RulesOptions, ResolverOptions, JSCodeOptions {
151
151
/// Whether to run as a development server.
152
152
final bool serverMode;
153
153
154
+ /// Whether to enable hash-based caching of files.
155
+ final bool enableHashing;
156
+
154
157
/// Port used for the HTTP server when [serverMode] is on.
155
158
final int port;
156
159
@@ -232,14 +235,18 @@ class CompilerOptions implements RulesOptions, ResolverOptions, JSCodeOptions {
232
235
this .nonnullableTypes: TypeOptions .NONNULLABLE_TYPES , this .help: false ,
233
236
this .useMockSdk: false , this .dartSdkPath, this .logLevel: Level .SEVERE ,
234
237
this .emitSourceMaps: true , this .entryPointFile: null ,
235
- this .serverMode: false , this .host : 'localhost' , this .port : 8080 ,
236
- this .runtimeDir});
238
+ this .serverMode: false , this .enableHashing : false , this .host : 'localhost' ,
239
+ this .port : 8080 , this . runtimeDir});
237
240
}
238
241
239
242
/// Parses options from the command-line
240
243
CompilerOptions parseOptions (List <String > argv) {
241
244
ArgResults args = argParser.parse (argv);
242
245
var serverMode = args['server' ];
246
+ var enableHashing = args['hashing' ];
247
+ if (enableHashing == null ) {
248
+ enableHashing = serverMode;
249
+ }
243
250
var logLevel = serverMode ? Level .ALL : Level .SEVERE ;
244
251
var levelName = args['log' ];
245
252
if (levelName != null ) {
@@ -294,6 +301,7 @@ CompilerOptions parseOptions(List<String> argv) {
294
301
emitSourceMaps: args['source-maps' ],
295
302
entryPointFile: args.rest.length == 0 ? null : args.rest.first,
296
303
serverMode: serverMode,
304
+ enableHashing: enableHashing,
297
305
host: args['host' ],
298
306
port: int .parse (args['port' ]),
299
307
runtimeDir: runtimeDir);
@@ -360,6 +368,8 @@ final ArgParser argParser = new ArgParser()
360
368
// general options
361
369
..addFlag ('help' , abbr: 'h' , help: 'Display this message' )
362
370
..addFlag ('server' , help: 'Run as a development server.' , defaultsTo: false )
371
+ ..addFlag ('hashing' ,
372
+ help: 'Enable hash-based file caching.' , defaultsTo: null )
363
373
..addOption ('host' ,
364
374
help: 'Host name or address to serve files from, e.g. --host=0.0.0.0\n '
365
375
'to listen on all interfaces (used only when --serve is on)' ,
0 commit comments