zorphyBuilder function

Builder zorphyBuilder(
  1. BuilderOptions options
)

Creates the build_runner builder for Zorphy code generation.

Note: The plugins builder option is currently reserved for future use (v2.1+). URI-based plugin loading is not yet implemented. For now, plugins must be registered programmatically by passing a pre-populated PluginRegistry to ZorphyGenerator.

Example build.yaml:

targets:
  $default:
    builders:
      zorphy:
        options:
          plugins:
            - package:my_plugin/my_plugin.dart
          dry_run: false
          force: false

When no plugins option is present, behavior is byte-identical to the pre-plugin pipeline (zero regressions).

Implementation

Builder zorphyBuilder(BuilderOptions options) {
  final pluginUris = _extractPluginUris(options);
  final isDryRun = options.config['dry_run'] == true;
  final isForce = options.config['force'] == true;
  return PartBuilder(
    [
      ZorphyGenerator(
        pluginUris: pluginUris,
        isDryRun: isDryRun,
        isForce: isForce,
      ),
    ],
    '.zorphy.dart',
    header: '''
// ignore_for_file: UNNECESSARY_CAST
// ignore_for_file: type=lint
''',
  );
}