Skip to content

Commit d091cdd

Browse files
committed
652
1 parent 5658092 commit d091cdd

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

tool/task.dart

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -765,20 +765,8 @@ Future<void> validateBuild() async {
765765

766766
await buildAll();
767767

768-
const analyzerTarget = '6.5.0';
769-
String getAnalyzerInUse() {
770-
var lockfilePath = path.join(Directory.current.path, 'pubspec.lock');
771-
var lockfile = loadYaml(File(lockfilePath).readAsStringSync()) as YamlMap;
772-
var packages = lockfile['packages'] as YamlMap;
773-
var analyzer = packages['analyzer'] as YamlMap;
774-
return analyzer['version'] as String;
775-
}
776-
777-
var analyzerInUse = getAnalyzerInUse();
778-
779768
for (var relPath in _generatedFilesList) {
780-
if (relPath.contains('runtime_renderers') &&
781-
analyzerTarget != analyzerInUse) {
769+
if (relPath.contains('runtime_renderers') && !_analyzerInUseIsTarget) {
782770
// The content of these files is very specific to the version of the
783771
// analyzer package in use. So we only validate if we are working on that
784772
// exact version.
@@ -818,6 +806,16 @@ Rebuild them with "dart tool/task.dart build" and check the results in.
818806
}
819807
}
820808

809+
bool get _analyzerInUseIsTarget {
810+
var lockfilePath = path.join(Directory.current.path, 'pubspec.lock');
811+
var lockfile = loadYaml(File(lockfilePath).readAsStringSync()) as YamlMap;
812+
var packages = lockfile['packages'] as YamlMap;
813+
var analyzer = packages['analyzer'] as YamlMap;
814+
var analyzerInUse = analyzer['version'] as String;
815+
const analyzerTarget = '6.5.2';
816+
return analyzerInUse == analyzerTarget;
817+
}
818+
821819
/// Paths in this list are relative to lib/.
822820
final _generatedFilesList = [
823821
'../dartdoc_options.yaml',

0 commit comments

Comments
 (0)