Closed Vildnex closed 7 months ago
If you run dart run build_runner doctor
I think it will highlight the issue, which is a mismatch in build extensions (the build extension in your build.yaml isn't what the actual builder is declaring, and the latter is what is actually used).
I don't believe that LibraryBuilder
allows you to configure the extensions in such a way that you could support this, ~but its worth filing an issue on the source_gen
package to ask for it?~ (I just transferred the issue here).
Essentially the core of the issue is that LibraryBuilder only allows you to configure the output extensions part of build extensions, and not the input extension (which is hardcoded to .dart
). You would need to configure both.
@jakemac53, the output of the dart run build_runner doctor
is [WARNING] Builder test_app:export_locating_builder uses input extension .dart which is not specified in the 'build.yaml'
but I am not entirely sure how to fix it. So basically because the LibraryBuilder
does not have support for this, what other Builder should I use? Or there is no other way to do this except building my own Builder?
Or there is no other way to do this except building my own Builder?
Essentially this, the source_gen
package is pretty opinionated today about output extensions. Afaik it does this somewhat in order to simplify some of the things it does (such as checking that the user included the appropriate part
file, where relevant).
You can fwiw re-use some of the utilities provided by this package to help create the builder though.
I see, alright then thanks for clarify this
Dart SDK version: 3.2.1 (stable) (None) on "linux_x64"
Current folder project structure after running that command:
Current folder project structure after generating them into the custom folder:
entity_generator.dart:
build.yaml:
For the moment even if I did the part {{}} the files will still be generated next to the original class instead of the
gen
folder.Linux
Not applicable
None
Sources that I've checked already: