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

Side by Side Diff: pkg/front_end/test/src/incremental/kernel_driver_test.dart

Issue 2992173002: Get logger / fileSystem / byteStore from ProcessedOptions. (Closed)
Patch Set: Created 3 years, 4 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 | « pkg/front_end/lib/src/incremental_kernel_generator_impl.dart ('k') | no next file » | 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) 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 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 Map<String, Uri> dartLibraries = createSdkFiles(fileSystem);
654 var uriTranslator = 654 var uriTranslator =
655 new UriTranslatorImpl(dartLibraries, {}, new MapPackages(packages)); 655 new UriTranslatorImpl(dartLibraries, {}, new MapPackages(packages));
656 driver = new KernelDriver( 656 driver = new KernelDriver(
657 new PerformanceLog(null),
658 fileSystem,
659 new MemoryByteStore(),
660 uriTranslator,
661 new ProcessedOptions(new CompilerOptions() 657 new ProcessedOptions(new CompilerOptions()
658 ..logger = new PerformanceLog(null)
659 ..fileSystem = fileSystem
660 ..byteStore = new MemoryByteStore()
662 ..strongMode = true 661 ..strongMode = true
663 ..target = new NoneTarget(new TargetFlags(strongMode: true))), 662 ..target = new NoneTarget(new TargetFlags(strongMode: true))),
663 uriTranslator,
664 fileAddedFn: fileAddedFn); 664 fileAddedFn: fileAddedFn);
665 } 665 }
666 666
667 Library _getLibrary(KernelResult result, Uri uri) { 667 Library _getLibrary(KernelResult result, Uri uri) {
668 for (var cycleResult in result.results) { 668 for (var cycleResult in result.results) {
669 for (var library in cycleResult.kernelLibraries) { 669 for (var library in cycleResult.kernelLibraries) {
670 if (library.importUri == uri) return library; 670 if (library.importUri == uri) return library;
671 } 671 }
672 } 672 }
673 throw fail('No library found with URI "$uri"'); 673 throw fail('No library found with URI "$uri"');
(...skipping 12 matching lines...) Expand all
686 .writeLibraryFile(library); 686 .writeLibraryFile(library);
687 return buffer.toString(); 687 return buffer.toString();
688 } 688 }
689 689
690 /// Return the [Uri] for the given Posix [path]. 690 /// Return the [Uri] for the given Posix [path].
691 static Uri _folderUri(String path) { 691 static Uri _folderUri(String path) {
692 if (!path.endsWith('/')) path += '/'; 692 if (!path.endsWith('/')) path += '/';
693 return Uri.parse('file://$path'); 693 return Uri.parse('file://$path');
694 } 694 }
695 } 695 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/incremental_kernel_generator_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698