build method
Generates the outputs for a given BuildStep
.
Implementation
@override
Future<void> build(BuildStep buildStep) async {
// Only process pubspec.yaml
if (!buildStep.inputId.path.endsWith('pubspec.yaml')) {
return;
}
try {
// Process lib/ files
await _generateMapperFile(
buildStep,
'lib/**.rdf_mapper.cache.json',
'lib/init_rdf_mapper.g.dart',
isTest: false,
);
// Process test/ files
await _generateMapperFile(
buildStep,
'test/**.rdf_mapper.cache.json',
'test/init_test_rdf_mapper.g.dart',
isTest: true,
);
} catch (e, stackTrace) {
log.severe(
'Error generating RDF mapper initialization files: $e',
e,
stackTrace,
);
rethrow;
}
}