Closed andrew-tpz closed 2 years ago
Hi andrew,
so the idea is to make it configurable (via environments?) where the generated files will be placed?
If the yaml is also able to read environments, this should be fairly easy to implement by adding the location in the generator/build.yaml
Hi, I can set output folder for json_serializable and freezed by adding build.yaml to my project:
targets:
$default:
builders:
source_gen|combining_builder:
options:
build_extensions:
'^lib/{{}}.dart': 'lib/gen/{{}}.g.dart'
freezed:
options:
build_extensions:
'^lib/{{}}.dart': 'lib/gen/{{}}.freezed.dart'
After that all .g.dart and .freezed.dart files are saved into "/lib/gen/..." root folder. I want to place all *.mapper.g.dart files there too.
Fixed with #60
Maybe this can help: https://github.com/dart-lang/source_gen/tree/master/source_gen#generating-files-in-different-directories