build method
Generates the outputs for a given BuildStep
.
Implementation
@override
FutureOr<void> build(BuildStep buildStep) async {
final lib = await buildStep.resolver
.libraryFor(buildStep.inputId, allowSyntaxErrors: false);
final infoGenerator = InfoGenerator(builderOptions);
final data = await infoGenerator.generate(LibraryReader(lib), buildStep);
if (data == null) {
return;
}
await buildStep.writeAsString(buildStep.allowedOutputs.single, data);
}