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

Implement 'new' in C++. #613

Merged
merged 13 commits into from
Jul 18, 2022
Merged

Conversation

BillyONeal
Copy link
Member

This replaces the TypeScript implementation of new with a C++ one. Other changes:

image

image

Most callers were just default-initializing JsonStyle which is equivalent to the WithSpaces(2) form.
WithSpaces(2) and default-initialized changed to call the new overload(s).
Callers who were stringifying 2 Json entities just to compare their strings also dropped the style parameter.
Callers who were using anything else were left alone.
This replaces the TypeScript implementation of new with a C++ one. Other changes:

* Now creates both vcpkg.json and vcpkg-configuration.json, which resolves "vcpkg new does not create vcpkg.json" https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1494967
* vcpkg-configuration.json can be embedded into vcpkg.json with --single-file.
* Now fills in the default registry with the current baseline git SHA.
* --name and --version are now mandatory since we are creating vcpkg.json, but they can be skipped with --application as per microsoft#605
@BillyONeal BillyONeal marked this pull request as ready for review July 6, 2022 00:23
bool option_version_relaxed,
bool option_version_date,
bool option_version_string)
{
Copy link
Contributor

Choose a reason for hiding this comment

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

This is just personal preference, but the function could be easier to digest if it were split into smaller chunks for each option and just pass the manifest as an argument.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure I understand: the manifest is the return value? Can you show the declarations you'd be looking for?

@BillyONeal BillyONeal merged commit 96b07ad into microsoft:main Jul 18, 2022
@BillyONeal BillyONeal deleted the new-vcpkg-json branch July 18, 2022 23:48
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.

3 participants