@@ -186,7 +186,8 @@ Future<void> buildWeb({bool debug = false}) async {
186186 throw StateError ('Compiled CSS was empty.' );
187187 }
188188
189- var compileSig = await _calcDartFilesSig (Directory ('web' ));
189+ var compileSig =
190+ await _calcFilesSig (Directory ('web' ), extensions: {'.dart' , '.scss' });
190191 File (path.join ('web' , 'sig.txt' )).writeAsStringSync ('$compileSig \n ' );
191192}
192193
@@ -198,14 +199,14 @@ void _delete(FileSystemEntity entity) {
198199 }
199200}
200201
201- /// Yields all of the trimmed lines of all of the `.dart` files in [dir] .
202- Stream <String > _dartFileLines (Directory dir) {
202+ /// Yields all of the trimmed lines of all of the files in [dir] with
203+ /// one of the specified [extensions] .
204+ Stream <String > _fileLines (Directory dir, {required Set <String > extensions}) {
203205 var files = dir
204206 .listSync (recursive: true )
205207 .whereType <File >()
206- .where ((file) => file.path.endsWith ('.dart' ))
207- .toList ()
208- ..sort ((a, b) => compareAsciiLowerCase (a.path, b.path));
208+ .where ((file) => extensions.contains (path.extension (file.path)))
209+ .sorted ((a, b) => compareAsciiLowerCase (a.path, b.path));
209210
210211 return Stream .fromIterable ([
211212 for (var file in files)
@@ -833,7 +834,8 @@ Rebuild them with "dart tool/task.dart build" and check the results in.
833834 }
834835
835836 // Verify that the web frontend has been compiled.
836- final currentCodeSig = await _calcDartFilesSig (Directory ('web' ));
837+ final currentCodeSig =
838+ await _calcFilesSig (Directory ('web' ), extensions: {'.dart' , '.scss' });
837839 final lastCompileSig =
838840 File (path.join ('web' , 'sig.txt' )).readAsStringSync ().trim ();
839841 if (currentCodeSig != lastCompileSig) {
@@ -994,8 +996,11 @@ int _findCount(String str, String match) {
994996 return count;
995997}
996998
997- Future <String > _calcDartFilesSig (Directory dir) async {
998- final digest = await _dartFileLines (dir)
999+ Future <String > _calcFilesSig (
1000+ Directory dir, {
1001+ required Set <String > extensions,
1002+ }) async {
1003+ final digest = await _fileLines (dir, extensions: extensions)
9991004 .transform (utf8.encoder)
10001005 .transform (crypto.md5)
10011006 .single;
0 commit comments