@@ -66,44 +66,50 @@ class ResidentWebRunner {
6666 ProjectFileInvalidator ? _projectFileInvalidator;
6767 WebDevFS ? devFS;
6868 Uri ? uri;
69- late Iterable <String > modules;
7069
7170 Future <int > run (
7271 FileSystem fileSystem, {
7372 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,
8275 }) async {
8376 _projectFileInvalidator ?? = ProjectFileInvalidator (fileSystem: fileSystem);
8477 devFS ?? = WebDevFS (
8578 fileSystem: fileSystem,
8679 hostname: hostname ?? 'localhost' ,
87- port: port! ,
80+ port: port,
8881 projectDirectory: projectDirectory,
8982 packageUriMapper: packageUriMapper,
90- index: index! ,
83+ index: index,
9184 urlTunneler: urlTunneler,
9285 sdkLayout: sdkLayout,
9386 compilerOptions: compilerOptions,
9487 );
9588 uri ?? = await devFS! .create ();
9689
9790 final report = await _updateDevFS (
98- initialCompile: initialCompile,
99- fullRestart: fullRestart,
100- fileServerUri: fileServerUri);
91+ initialCompile: true , fullRestart: false , fileServerUri: null );
10192 if (! report.success) {
10293 _logger.severe ('Failed to compile application.' );
10394 return 1 ;
10495 }
10596
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+ }
107113
108114 generator.accept ();
109115 return 0 ;
@@ -113,8 +119,8 @@ class ResidentWebRunner {
113119 required bool initialCompile,
114120 required bool fullRestart,
115121 // 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.
118124 required Uri ? fileServerUri,
119125 }) async {
120126 final invalidationResult = await _projectFileInvalidator! .findInvalidated (
0 commit comments