-
-
Notifications
You must be signed in to change notification settings - Fork 227
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
"dub convert" command to convert between dub.json and dub.sdl. Fixes #689. #732
Conversation
802cf29
to
705c01c
Compare
ef8a793
to
e506f3d
Compare
|
It might not be a bad idea to explicitly warn the user that the old config file will be deleted. It's not a major issue if people are using source control properly, but it seems dicey to rely on that. |
|
It has a warning on the |
|
Probably. I'm just thinking of the few users who might get tripped up, but with bidirectional conversion, it shouldn't be an issue unless there's a bug in the converter. Does the converter at least ensure that the new file is written before the old one is deleted? |
|
Yes, the new file is written before deleting the old one (any error will skip the deletion). |
|
Coverage looks good https://coveralls.io/builds/4673014/source?filename=source%2Fdub%2Frecipe%2Fsdl.d. |
| foreach (suffix, arr; bs.preBuildCommands) adda("preBuildCommands", suffix, arr); | ||
| foreach (suffix, arr; bs.postBuildCommands) adda("postBuildCommands", suffix, arr); | ||
| foreach (suffix, bits; bs.buildRequirements) adda("buildRequirements", suffix, toNameArray!BuildRequirement(bits)); | ||
| foreach (suffix, bits; bs.buildOptions) adda("buildOptions", suffix, toNameArray!BuildOption(bits)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a 1-to-1 mapping, so maybe use generic code and convert all members of bs? You could blacklist members that shouldn't be converted, but doing this makes it impossible to forget something and will be easier to maintain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to postpone that to a separate PR - and then also for de-serialization and for JSON.
2da1161
to
5855923
Compare
|
Fixed and rebased. |
"dub convert" command to convert between dub.json and dub.sdl. Fixes #689.
No description provided.