Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change output folder #138

Closed
hatch01 opened this issue Oct 20, 2023 · 2 comments
Closed

change output folder #138

hatch01 opened this issue Oct 20, 2023 · 2 comments

Comments

@hatch01
Copy link
Contributor

hatch01 commented Oct 20, 2023

I'm really interested in this package, with seems incredible.
However, in my projects, I have folders with many models in it. So generating.mapper.g in the same folder makes it unreadable.
When I user for example copywith of freezed or json_serialize, I written in my build.yaml :

targets:
  $default:
    builders:
      source_gen|combining_builder:
        generate_for:
          - lib/**.dart
        options:
          build_extensions:
            'lib/{{path}}/{{file}}.dart': 'lib/{{path}}/generated/{{file}}.g.dart'

I tried to replace source_gen|combining_builder with dart_mappable_builder, but it didn't work.
I do not really understand what I'm doing with the build.yaml, but I think that having a different output dir is just not yet planned.
If anyone has an idea, without modifier dart_mappable, it's perfect. Otherwise, I can make the modification if someone gives me some indication of the process to follow.

@schultek
Copy link
Owner

This package does not use the source_gen builders, therefore the config has no effect.

For this to work the dart_mappable_builder package would need some modification, similar to how the combining_builder accepts the build_extensions here: https://github.com/dart-lang/source_gen/blob/master/source_gen/lib/builder.dart

@hatch01
Copy link
Contributor Author

hatch01 commented Nov 17, 2023

done in #140

@hatch01 hatch01 closed this as completed Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants