chopperGeneratorFactory function

Builder chopperGeneratorFactory(
  1. BuilderOptions options
)

Creates a PartBuilder used to generate code for ChopperApi annotated classes. The options are provided by Dart's build system and read from the build.yaml file.

Implementation

Builder chopperGeneratorFactory(BuilderOptions options) => PartBuilder(
      [const ChopperGenerator()],
      '.chopper.dart',
      header: options.config['header'],
      formatOutput:
          PartBuilder([const ChopperGenerator()], '.chopper.dart').formatOutput,
      options: !options.config.containsKey('build_extensions')
          ? options.overrideWith(
              BuilderOptions({
                'build_extensions': {'.dart': '.chopper.dart'},
              }),
            )
          : options,
    );