OLD | NEW |
1 #!/usr/bin/env dart | 1 #!/usr/bin/env dart |
2 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 2 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
3 // for details. All rights reserved. Use of this source code is governed by a | 3 // for details. All rights reserved. Use of this source code is governed by a |
4 // BSD-style license that can be found in the LICENSE file. | 4 // BSD-style license that can be found in the LICENSE file. |
5 | 5 |
6 import 'dart:async'; | 6 import 'dart:async'; |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 | 8 |
9 import 'batch_util.dart'; | 9 import 'batch_util.dart'; |
10 import 'util.dart'; | 10 import 'util.dart'; |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 | 298 |
299 Program program; | 299 Program program; |
300 | 300 |
301 var watch = new Stopwatch()..start(); | 301 var watch = new Stopwatch()..start(); |
302 List<String> loadedFiles; | 302 List<String> loadedFiles; |
303 Function getLoadedFiles; | 303 Function getLoadedFiles; |
304 List errors = const []; | 304 List errors = const []; |
305 TargetFlags targetFlags = new TargetFlags( | 305 TargetFlags targetFlags = new TargetFlags( |
306 strongMode: options['strong'], | 306 strongMode: options['strong'], |
307 treeShake: options['tree-shake'], | 307 treeShake: options['tree-shake'], |
| 308 kernelRuntime: Platform.script.resolve('../runtime/'), |
308 programRoots: programRoots); | 309 programRoots: programRoots); |
309 Target target = getTarget(options['target'], targetFlags); | 310 Target target = getTarget(options['target'], targetFlags); |
310 | 311 |
311 var declaredVariables = <String, String>{}; | 312 var declaredVariables = <String, String>{}; |
312 declaredVariables.addAll(target.extraDeclaredVariables); | 313 declaredVariables.addAll(target.extraDeclaredVariables); |
313 for (String define in options['D']) { | 314 for (String define in options['D']) { |
314 int separator = define.indexOf('='); | 315 int separator = define.indexOf('='); |
315 if (separator == -1) { | 316 if (separator == -1) { |
316 fail('Invalid define: -D$define. Format is -D<name>=<value>'); | 317 fail('Invalid define: -D$define. Format is -D<name>=<value>'); |
317 } | 318 } |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 int flushTime = watch.elapsedMilliseconds - time; | 422 int flushTime = watch.elapsedMilliseconds - time; |
422 print('writer.flush_time = $flushTime ms'); | 423 print('writer.flush_time = $flushTime ms'); |
423 } | 424 } |
424 | 425 |
425 if (options['tolerant']) { | 426 if (options['tolerant']) { |
426 return CompilerOutcome.Ok; | 427 return CompilerOutcome.Ok; |
427 } | 428 } |
428 | 429 |
429 return errors.length > 0 ? CompilerOutcome.Fail : CompilerOutcome.Ok; | 430 return errors.length > 0 ? CompilerOutcome.Fail : CompilerOutcome.Ok; |
430 } | 431 } |
OLD | NEW |