OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'dart:async'; | 5 import 'dart:async'; |
6 | 6 |
7 import 'package:front_end/compiler_options.dart'; | 7 import 'package:front_end/compiler_options.dart'; |
8 import 'package:front_end/memory_file_system.dart'; | 8 import 'package:front_end/memory_file_system.dart'; |
9 import 'package:front_end/src/base/performace_logger.dart'; | 9 import 'package:front_end/src/base/performace_logger.dart'; |
10 import 'package:front_end/src/base/processed_options.dart'; | 10 import 'package:front_end/src/base/processed_options.dart'; |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 expect(libraryUris, contains(shouldInclude)); | 643 expect(libraryUris, contains(shouldInclude)); |
644 } | 644 } |
645 for (var shouldExclude in excludes) { | 645 for (var shouldExclude in excludes) { |
646 expect(libraryUris, isNot(contains(shouldExclude))); | 646 expect(libraryUris, isNot(contains(shouldExclude))); |
647 } | 647 } |
648 } | 648 } |
649 | 649 |
650 /// Create new [KernelDriver] instance and put it into the [driver] field. | 650 /// Create new [KernelDriver] instance and put it into the [driver] field. |
651 void _createDriver( | 651 void _createDriver( |
652 {Map<String, Uri> packages, KernelDriverFileAddedFn fileAddedFn}) { | 652 {Map<String, Uri> packages, KernelDriverFileAddedFn fileAddedFn}) { |
653 Map<String, Uri> dartLibraries = createSdkFiles(fileSystem); | 653 var uriTranslator = new UriTranslatorImpl( |
654 var uriTranslator = | 654 createSdkFiles(fileSystem), new MapPackages(packages)); |
655 new UriTranslatorImpl(dartLibraries, {}, new MapPackages(packages)); | |
656 driver = new KernelDriver( | 655 driver = new KernelDriver( |
657 new ProcessedOptions(new CompilerOptions() | 656 new ProcessedOptions(new CompilerOptions() |
658 ..logger = new PerformanceLog(null) | 657 ..logger = new PerformanceLog(null) |
659 ..fileSystem = fileSystem | 658 ..fileSystem = fileSystem |
660 ..byteStore = new MemoryByteStore() | 659 ..byteStore = new MemoryByteStore() |
661 ..strongMode = true | 660 ..strongMode = true |
662 ..target = new NoneTarget(new TargetFlags(strongMode: true))), | 661 ..target = new NoneTarget(new TargetFlags(strongMode: true))), |
663 uriTranslator, | 662 uriTranslator, |
664 fileAddedFn: fileAddedFn); | 663 fileAddedFn: fileAddedFn); |
665 } | 664 } |
(...skipping 20 matching lines...) Expand all Loading... |
686 .writeLibraryFile(library); | 685 .writeLibraryFile(library); |
687 return buffer.toString(); | 686 return buffer.toString(); |
688 } | 687 } |
689 | 688 |
690 /// Return the [Uri] for the given Posix [path]. | 689 /// Return the [Uri] for the given Posix [path]. |
691 static Uri _folderUri(String path) { | 690 static Uri _folderUri(String path) { |
692 if (!path.endsWith('/')) path += '/'; | 691 if (!path.endsWith('/')) path += '/'; |
693 return Uri.parse('file://$path'); | 692 return Uri.parse('file://$path'); |
694 } | 693 } |
695 } | 694 } |
OLD | NEW |