| 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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 declaredVariables: declaredVariables, | 333 declaredVariables: declaredVariables, |
| 334 applicationRoot: applicationRoot); | 334 applicationRoot: applicationRoot); |
| 335 String packageDiscoveryPath = batchModeState.isBatchMode ? null : file; | 335 String packageDiscoveryPath = batchModeState.isBatchMode ? null : file; |
| 336 DartLoader loader = await batchModeState.batch.getLoader( | 336 DartLoader loader = await batchModeState.batch.getLoader( |
| 337 repository, dartOptions, | 337 repository, dartOptions, |
| 338 packageDiscoveryPath: packageDiscoveryPath); | 338 packageDiscoveryPath: packageDiscoveryPath); |
| 339 if (options['link']) { | 339 if (options['link']) { |
| 340 program = loader.loadProgram(fileUri, target: target); | 340 program = loader.loadProgram(fileUri, target: target); |
| 341 } else { | 341 } else { |
| 342 var library = loader.loadLibrary(fileUri); | 342 var library = loader.loadLibrary(fileUri); |
| 343 loader.loadSdkInterface(program, target); |
| 343 assert(library == | 344 assert(library == |
| 344 repository.getLibraryReference(applicationRoot.relativeUri(fileUri))); | 345 repository.getLibraryReference(applicationRoot.relativeUri(fileUri))); |
| 345 program = new Program(repository.libraries); | 346 program = new Program(repository.libraries); |
| 346 } | 347 } |
| 347 errors = loader.errors; | 348 errors = loader.errors; |
| 348 if (errors.isNotEmpty) { | 349 if (errors.isNotEmpty) { |
| 349 const int errorLimit = 100; | 350 const int errorLimit = 100; |
| 350 stderr.writeln(errors.take(errorLimit).join('\n')); | 351 stderr.writeln(errors.take(errorLimit).join('\n')); |
| 351 if (errors.length > errorLimit) { | 352 if (errors.length > errorLimit) { |
| 352 stderr | 353 stderr |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 int flushTime = watch.elapsedMilliseconds - time; | 421 int flushTime = watch.elapsedMilliseconds - time; |
| 421 print('writer.flush_time = $flushTime ms'); | 422 print('writer.flush_time = $flushTime ms'); |
| 422 } | 423 } |
| 423 | 424 |
| 424 if (options['tolerant']) { | 425 if (options['tolerant']) { |
| 425 return CompilerOutcome.Ok; | 426 return CompilerOutcome.Ok; |
| 426 } | 427 } |
| 427 | 428 |
| 428 return errors.length > 0 ? CompilerOutcome.Fail : CompilerOutcome.Ok; | 429 return errors.length > 0 ? CompilerOutcome.Fail : CompilerOutcome.Ok; |
| 429 } | 430 } |
| OLD | NEW |