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

add the possibility to set a build_extensions option in the build.yaml #140

Merged
merged 5 commits into from
Dec 3, 2023
Merged

Conversation

hatch01
Copy link
Contributor

@hatch01 hatch01 commented Oct 23, 2023

We can now add a yaml options: build_extensions: 'lib/{{path}}/{{file}}.dart': ['lib/{{path}}/generated/{{file}}.mapper.dart', 'lib/{{path}}/generated/{{file}}.init.dart']
To a build.yaml to specify where to put the built files.
I did not find any mappableContainer in the exemples so I'm not shure that it works perfectly for the mappablecontainer. For the others generation, it works like a charm.

Copy link
Owner

@schultek schultek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this generally looks ok. What is still missing is some documentation for this. Please add a small doc for this in packages/dart_mappable/doc/configuration.md under Global Options.

@@ -138,6 +137,7 @@ class MappableBuilder implements Builder {

output.write('}');

final outputId = buildStep.allowedOutputs.last;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also adjust the code regarding writeImports (see line 125 and 153) , since this currently assumes the output is under the same path as the input.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I attempted to follow your instructions, but please double-check them, as I'm uncertain about what you wanted.

packages/dart_mappable_builder/test/simple_model_test.dart Outdated Show resolved Hide resolved
@schultek
Copy link
Owner

Also, closes #138

@hatch01 hatch01 mentioned this pull request Nov 17, 2023
@schultek
Copy link
Owner

schultek commented Dec 3, 2023

I corrected the import paths.

@schultek schultek merged commit 126caeb into schultek:main Dec 3, 2023
1 check failed
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

Successfully merging this pull request may close these issues.

2 participants