@@ -66,44 +66,50 @@ class ResidentWebRunner {
66
66
ProjectFileInvalidator ? _projectFileInvalidator;
67
67
WebDevFS ? devFS;
68
68
Uri ? uri;
69
- late Iterable <String > modules;
70
69
71
70
Future <int > run (
72
71
FileSystem fileSystem, {
73
72
String ? hostname,
74
- int ? port,
75
- String ? index,
76
- required bool initialCompile,
77
- required bool fullRestart,
78
- // The uri of the `HttpServer` that handles file requests.
79
- // TODO(srujzs): This should be the same as the uri of the AssetServer, but
80
- // currently is not. Delete when that's fixed.
81
- required Uri ? fileServerUri,
73
+ required int port,
74
+ required String index,
82
75
}) async {
83
76
_projectFileInvalidator ?? = ProjectFileInvalidator (fileSystem: fileSystem);
84
77
devFS ?? = WebDevFS (
85
78
fileSystem: fileSystem,
86
79
hostname: hostname ?? 'localhost' ,
87
- port: port! ,
80
+ port: port,
88
81
projectDirectory: projectDirectory,
89
82
packageUriMapper: packageUriMapper,
90
- index: index! ,
83
+ index: index,
91
84
urlTunneler: urlTunneler,
92
85
sdkLayout: sdkLayout,
93
86
compilerOptions: compilerOptions,
94
87
);
95
88
uri ?? = await devFS! .create ();
96
89
97
90
final report = await _updateDevFS (
98
- initialCompile: initialCompile,
99
- fullRestart: fullRestart,
100
- fileServerUri: fileServerUri);
91
+ initialCompile: true , fullRestart: false , fileServerUri: null );
101
92
if (! report.success) {
102
93
_logger.severe ('Failed to compile application.' );
103
94
return 1 ;
104
95
}
105
96
106
- modules = report.invalidatedModules! ;
97
+ generator.accept ();
98
+ return 0 ;
99
+ }
100
+
101
+ Future <int > rerun (
102
+ {required bool fullRestart,
103
+ // The uri of the `HttpServer` that handles file requests.
104
+ // TODO(srujzs): This should be the same as the uri of the AssetServer to
105
+ // align with Flutter tools, but currently is not. Delete when that's fixed.
106
+ required Uri fileServerUri}) async {
107
+ final report = await _updateDevFS (
108
+ initialCompile: false , fullRestart: fullRestart, fileServerUri: null );
109
+ if (! report.success) {
110
+ _logger.severe ('Failed to compile application.' );
111
+ return 1 ;
112
+ }
107
113
108
114
generator.accept ();
109
115
return 0 ;
@@ -113,8 +119,8 @@ class ResidentWebRunner {
113
119
required bool initialCompile,
114
120
required bool fullRestart,
115
121
// The uri of the `TestServer` that handles file requests.
116
- // TODO(srujzs): This should be the same as the uri of the AssetServer, but
117
- // currently is not. Delete when that's fixed.
122
+ // TODO(srujzs): This should be the same as the uri of the AssetServer to
123
+ // align with Flutter tools, but currently is not. Delete when that's fixed.
118
124
required Uri ? fileServerUri,
119
125
}) async {
120
126
final invalidationResult = await _projectFileInvalidator! .findInvalidated (
0 commit comments