build method

  1. @override
FutureOr<void> build(
  1. BuildStep buildStep
)

Generates the outputs for a given BuildStep.

Implementation

@override
FutureOr<void> build(BuildStep buildStep) async {
  final inputId = buildStep.inputId;
  final outputId = inputId.changeExtension('.idl.dart');
  final contents = await buildStep.readAsString(inputId);
  final fileName = inputId.pathSegments.last;
  final code = did2dart(fileName, contents, option);
  await buildStep.writeAsString(outputId, code);
}