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

Single output #184

Closed
bielik01 opened this issue Oct 11, 2023 · 8 comments · Fixed by #200
Closed

Single output #184

bielik01 opened this issue Oct 11, 2023 · 8 comments · Fixed by #200
Assignees
Labels
enhancement New feature, bug fix, or request

Comments

@bielik01
Copy link

Why using CLI (reading settings from .reffiter file) I get two outputs?
One in outputFolder specified in settings file, but with name from that file name (i.e. test.refitter -> test.g.cs) and another one named Ouput.cs in directory from which I ran the command?

Please, add outputFileName to .reffiter settings so that only one output is produced.

@bielik01 bielik01 added the enhancement New feature, bug fix, or request label Oct 11, 2023
@christianhelle
Copy link
Owner

@bielik01 thanks for taking the time to report this

The .g.cs output file was a remnant of the initial source generator implementation. In the original implementation, which didn't work, the output file was never persisted to disk (the normal behavior for source generators). Unfortunately, source generators ran independently of each other and the Refit source generator didn't know that Refitter generated a Refit interface

I'll fix this by adding the outputFileName that you suggest

@christianhelle
Copy link
Owner

@all-contributors please add @bielik01 for bugs

@allcontributors
Copy link
Contributor

@christianhelle

I've put up a pull request to add @bielik01! 🎉

@bielik01
Copy link
Author

Thanks a lot! I try to keep files in the project to minimum 😅

@christianhelle
Copy link
Owner

@bielik01 Do you use the Refitter.SourceGenerator package reference? This does some MSBuild magic that automagically includes any .refitter file as AdditionalFiles which allows the Refitter source generator to discover it upon build time, generating the .g.cs file. There wouldn't be a need to use the CLI tool if you're already using the source generator

Thanks a lot! I try to keep files in the project to minimum 😅

Perfectly understandable, I do the same. No code is better and faster than no code :)

@bielik01
Copy link
Author

Yeah, I just noticed what that package does, it's pure magic! But even then, I kinda want it to have name specified by me 😂

@christianhelle
Copy link
Owner

I'll try to implement this tonight

@christianhelle
Copy link
Owner

christianhelle commented Oct 15, 2023

@bielik01 This is implemented but not thoroughly tested yet. I'm taking a few days off for the autumn break to spend some time with the family

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature, bug fix, or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants