write method
Implementation
void write({
required List<File> specs,
required List<String> Function(File spec) outputPathsForSpec,
}) {
final manifest = <String, Object>{};
for (final spec in specs) {
final rel = p.relative(spec.path, from: projectRoot);
manifest[rel] = {
'hash': contentHash(spec),
'outputFiles': outputPathsForSpec(spec).map((path) => p.relative(path, from: projectRoot)).toList(),
};
}
manifestFile.parent.createSync(recursive: true);
const encoder = JsonEncoder.withIndent(' ');
manifestFile.writeAsStringSync('${encoder.convert(manifest)}\n');
}