4
4
5
5
import 'dart:async' show Future;
6
6
7
+ import 'package:front_end/src/api_prototype/file_system.dart' ;
7
8
import 'package:front_end/src/api_prototype/physical_file_system.dart' ;
8
9
import 'package:front_end/src/base/processed_options.dart' ;
9
10
import 'package:front_end/src/kernel_generator_impl.dart' ;
10
- import 'package:front_end/src/multi_root_file_system.dart' ;
11
11
import 'package:kernel/kernel.dart' show Program;
12
12
import 'package:kernel/target/targets.dart' show Target;
13
13
@@ -30,7 +30,8 @@ Future<InitializedCompilerState> initializeCompiler(
30
30
Uri sdkSummary,
31
31
Uri packagesFile,
32
32
List <Uri > inputSummaries,
33
- Target target) async {
33
+ Target target,
34
+ {FileSystem fileSystem}) async {
34
35
inputSummaries.sort ((a, b) => a.toString ().compareTo (b.toString ()));
35
36
bool listEqual (List <Uri > a, List <Uri > b) {
36
37
if (a.length != b.length) return false ;
@@ -59,23 +60,12 @@ Future<InitializedCompilerState> initializeCompiler(
59
60
return oldState;
60
61
}
61
62
62
- // To make the output .dill agnostic of the current working directory,
63
- // we use a custom-uri scheme for all app URIs (these are files outside the
64
- // lib folder). The following [FileSystem] will resolve those references to
65
- // the correct location and keeps the real file location hidden from the
66
- // front end.
67
- // TODO(sigmund): technically we don't need a "multi-root" file system,
68
- // because we are providing a single root, the alternative here is to
69
- // implement a new file system with a single root instead.
70
- var fileSystem = new MultiRootFileSystem (
71
- 'org-dartlang-app' , [Uri .base ], PhysicalFileSystem .instance);
72
-
73
63
CompilerOptions options = new CompilerOptions ()
74
64
..sdkSummary = sdkSummary
75
65
..packagesFileUri = packagesFile
76
66
..inputSummaries = inputSummaries
77
67
..target = target
78
- ..fileSystem = fileSystem
68
+ ..fileSystem = fileSystem ?? PhysicalFileSystem .instance
79
69
..chaseDependencies = true
80
70
..reportMessages = true ;
81
71
0 commit comments