1

I am trying to make my custom builder using Dart's https://github.com/dart-lang/source_gen.

The buildExtensions in builder.dart is .dart

It builds for any dart file

buildExtensions = { '.dart': [generatedExtension]..addAll(additionalOutputExtensions) },

enter image description here

So even if in build.yaml, I set the build input to .source.dart

  functionUnwrap:
    import: 'package:my_generators/my_generators.dart'
    builder_factories: ['functionUnwrapBuild']
    auto_apply: dependents
    build_extensions: {".source.dart": [".unwrapped.dart"]}
    build_to: source
    applies_builders: ["source_gen"]

It ignores the ".source.dart" and still runs on any dart file.

TSR
  • 17,242
  • 27
  • 93
  • 197
  • I need to do this too. Did you find a way? My builder generates `.keys.dart` files and I want to process `.dart` files but ignore `.g.dart` files. – buttonsrtoys Jan 19 '22 at 18:27

0 Answers0