generate method
Generates Dart code for an input Dart library.
May create additional outputs through the buildStep
, but the 'primary'
output is Dart code returned through the Future. If there is nothing to
generate for this library may return null, or a Future that resolves to
null or the empty string.
Implementation
@override
FutureOr<String?> generate(LibraryReader library, BuildStep step) async {
bool debug = options.config.containsKey('debug') ? options.config['debug'] : false;
if (library.element.parts.isNotEmpty) {
return await (
new CompiledOmGenerator(
new OutputWriter(debug),
library,
step,
new DiConfig(),
new GenerationTimer(),
debug
)
).generate();
}
return null;
}