dart-lang / source_gen

Automatic source code generation for Dart
https://pub.dev/packages/source_gen
BSD 3-Clause "New" or "Revised" License
482 stars 104 forks source link

Has any way to ignore WARNING? #698

Closed normidar closed 5 months ago

normidar commented 5 months ago

I have a generator output as cache use GeneratorForAnnotation.

But console always show a log that:

class.cache must be included as a part directive in the input library with:
    part 'class.cache';

I want to ignore this log.

jakemac53 commented 5 months ago

It sound like you want to produce a separate library, instead of a part file. To do this, instead of wrapping your generator in a SharedPartBuilder, wrap it in a LibraryBuilder.

normidar commented 5 months ago

I knew it, if I do not return string, it will not print warning