plan method
Implementation
IncrementalGenerationPlan plan({
required List<File> specs,
required List<String> Function(File spec) outputPathsForSpec,
}) {
final manifest = _readManifest();
final changed = <File>[];
for (final spec in specs) {
final rel = p.relative(spec.path, from: projectRoot);
final hash = contentHash(spec);
final entry = manifest[rel];
final cachedHash = entry is Map<String, dynamic> ? entry['hash'] as String? : null;
final outputPaths = outputPathsForSpec(spec);
final missingOutput = outputPaths.any((path) => !File(path).existsSync());
if (cachedHash != hash || missingOutput) {
changed.add(spec);
}
}
return IncrementalGenerationPlan(List.unmodifiable(changed));
}