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

Improve templates #2338

Merged
merged 7 commits into from Jul 1, 2023
Merged

Conversation

YegorStepanov
Copy link
Contributor

The framework parameter must be of type choice (see the discussion with the VS developers below).

Currently:
VS doesn't display the templates at all.
Rider displays it with disabled dropdown but crashes when creating project.
image

The choice type means that we have to write all the supported frameworks by hand.
I've added all version frameworks, that have not expired end-of-life:

Also we can no longer use platform-specific TFM:

dotnet new benchmark -f net7.0-windows

But it's ok because console use a choice too, so we cannot create platform-specific TFM:

dotnet new console -f net7.0-windows
// displays an error

More details with screenshots: sayedihashimi/template-sample#73

IDE screenshots

VS:
image
image

Rider:
image

fix #1881, fix #2149, fix #1658

the PR #1817 can be closed too?

@YegorStepanov
Copy link
Contributor Author

What is the reason it creates the library and not the console application by default? It is much more common to create the console application, and it is not very clear for beginners how to run tests (they need to re-read the documentation).

@@ -98,7 +144,7 @@
"type": "parameter",
"datatype": "string",
"description": "Version of BenchmarkDotNet that will be referenced.",
"defaultValue": "0.12.1",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

With each new release, you need to change this manually.

Currently, if you add BDN.Templates, a project will be created with BDN v0.12.1.

Copy link
Contributor

Choose a reason for hiding this comment

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

I try to handle this issue – #1879
@AndreyAkinshin could you take a look please ?

@@ -5,7 +5,7 @@ name: BenchmarkDotNet templates

# BenchmarkDotNet templates

BenchmarkDotNet provides project templates to setup your benchmarks easily
BenchmarkDotNet provides project templates to setup your benchmarks easily.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is only one space, I think there should be a new paragraph here (a second space is needed)

@AndreyAkinshin
Copy link
Member

@YegorStepanov

What is the reason it creates the library and not the console application by default?

In the times of BDN v0.12.1, we were trying to promote the BenchmarkDotNet.Tool approach for running benchmarks. However, nowadays this approach is deprecated. Could you please switch the default option value of consoleApp to true?

@YegorStepanov YegorStepanov marked this pull request as draft July 1, 2023 10:30
@YegorStepanov
Copy link
Contributor Author

image

@YegorStepanov YegorStepanov marked this pull request as ready for review July 1, 2023 10:58
@AndreyAkinshin AndreyAkinshin self-requested a review July 1, 2023 11:22
@AndreyAkinshin AndreyAkinshin added this to the v0.13.6 milestone Jul 1, 2023
@AndreyAkinshin AndreyAkinshin merged commit dc3cefd into dotnet:master Jul 1, 2023
4 of 9 checks passed
@AndreyAkinshin
Copy link
Member

@YegorStepanov works like a charm! Thanks for updating the templates!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants