From 5ec4deb996ec3de217edd368b88814841dcea415 Mon Sep 17 00:00:00 2001 From: askazakov Date: Thu, 30 Dec 2021 11:22:12 +0500 Subject: [PATCH 1/6] adjust defaultBenchmarkDotNetVersion on build --- build/common.props | 24 ++++++++++++++++++++++ templates/BenchmarkDotNet.Templates.csproj | 14 +++++++++++++ 2 files changed, 38 insertions(+) diff --git a/build/common.props b/build/common.props index c2844cce61..f47bf45b13 100644 --- a/build/common.props +++ b/build/common.props @@ -62,4 +62,28 @@ all + + + + + + + + + + + + + + + + + diff --git a/templates/BenchmarkDotNet.Templates.csproj b/templates/BenchmarkDotNet.Templates.csproj index 9daf0672f8..2f5c02e776 100644 --- a/templates/BenchmarkDotNet.Templates.csproj +++ b/templates/BenchmarkDotNet.Templates.csproj @@ -24,4 +24,18 @@ + + + + + templates/BenchmarkDotNet.BenchmarkProjectTemplate.CSharp/.template.config/template.json + templates/BenchmarkDotNet.BenchmarkProjectTemplate.CSharp/.template.config/template.json + "defaultValue" : ([\d+\.?]+) + + \ No newline at end of file From c6bd682510b877463587bbf752b0e78acb07f035 Mon Sep 17 00:00:00 2001 From: askazakov Date: Tue, 4 Jul 2023 10:42:10 +0500 Subject: [PATCH 2/6] fix https://github.com/dotnet/BenchmarkDotNet/pull/1879#discussion_r1250960415 --- templates/BenchmarkDotNet.Templates.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/BenchmarkDotNet.Templates.csproj b/templates/BenchmarkDotNet.Templates.csproj index 2f5c02e776..e9ce1ca7d7 100644 --- a/templates/BenchmarkDotNet.Templates.csproj +++ b/templates/BenchmarkDotNet.Templates.csproj @@ -31,7 +31,7 @@ InputFilename="templates/BenchmarkDotNet.BenchmarkProjectTemplate.CSharp/.template.config/template.json" OutputFilename="templates/BenchmarkDotNet.BenchmarkProjectTemplate.CSharp/.template.config/template.json" MatchExpression='("defaultValue": )"([\d+\.?]+)"' - ReplacementText='${1}"$(Major).$(Minor).$(Revision)"' /> + ReplacementText='${1}"$(VersionPrefix)"' /> templates/BenchmarkDotNet.BenchmarkProjectTemplate.CSharp/.template.config/template.json templates/BenchmarkDotNet.BenchmarkProjectTemplate.CSharp/.template.config/template.json From 4f7eac2ed4ba27ffca5ed2384df0f882f18e3aa3 Mon Sep 17 00:00:00 2001 From: askazakov Date: Tue, 4 Jul 2023 10:44:26 +0500 Subject: [PATCH 3/6] fix https://github.com/dotnet/BenchmarkDotNet/pull/1879#discussion_r1250961663 --- templates/BenchmarkDotNet.Templates.csproj | 5 ----- 1 file changed, 5 deletions(-) diff --git a/templates/BenchmarkDotNet.Templates.csproj b/templates/BenchmarkDotNet.Templates.csproj index e9ce1ca7d7..37beafb494 100644 --- a/templates/BenchmarkDotNet.Templates.csproj +++ b/templates/BenchmarkDotNet.Templates.csproj @@ -32,10 +32,5 @@ OutputFilename="templates/BenchmarkDotNet.BenchmarkProjectTemplate.CSharp/.template.config/template.json" MatchExpression='("defaultValue": )"([\d+\.?]+)"' ReplacementText='${1}"$(VersionPrefix)"' /> - - templates/BenchmarkDotNet.BenchmarkProjectTemplate.CSharp/.template.config/template.json - templates/BenchmarkDotNet.BenchmarkProjectTemplate.CSharp/.template.config/template.json - "defaultValue" : ([\d+\.?]+) - \ No newline at end of file From 8ba62e2659b94f6473acfd029138ec22904a5710 Mon Sep 17 00:00:00 2001 From: askazakov Date: Tue, 4 Jul 2023 10:49:26 +0500 Subject: [PATCH 4/6] fix https://github.com/dotnet/BenchmarkDotNet/pull/1879#discussion_r1250963754 --- templates/BenchmarkDotNet.Templates.csproj | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/templates/BenchmarkDotNet.Templates.csproj b/templates/BenchmarkDotNet.Templates.csproj index 37beafb494..407c2398f2 100644 --- a/templates/BenchmarkDotNet.Templates.csproj +++ b/templates/BenchmarkDotNet.Templates.csproj @@ -32,5 +32,17 @@ OutputFilename="templates/BenchmarkDotNet.BenchmarkProjectTemplate.CSharp/.template.config/template.json" MatchExpression='("defaultValue": )"([\d+\.?]+)"' ReplacementText='${1}"$(VersionPrefix)"' /> + + + + \ No newline at end of file From 09142e52a1a5020d36b1729af34301496d6571bc Mon Sep 17 00:00:00 2001 From: askazakov Date: Tue, 4 Jul 2023 11:25:49 +0500 Subject: [PATCH 5/6] add install-from-source.sh (for macOS for example) --- templates/install-from-source.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 templates/install-from-source.sh diff --git a/templates/install-from-source.sh b/templates/install-from-source.sh new file mode 100755 index 0000000000..999d6564a7 --- /dev/null +++ b/templates/install-from-source.sh @@ -0,0 +1,13 @@ +# Run only from the folder where the batch file is located! + +dotnet build BenchmarkDotNet.Templates.csproj -c Release +dotnet pack BenchmarkDotNet.Templates.csproj -c Release + +# If we install the templates via a folder path, then it will have a different ID (ID=folder path). +# It will conflict with BDN templates from nuget. +# We need to install the templates via a FILE path in order to update the template from nuget. + +nupkg_path=$(find . -name "BenchmarkDotNet.Templates*.nupkg") + +dotnet new uninstall "BenchmarkDotNet.Templates" +dotnet new install $nupkg_path \ No newline at end of file From 54026d271ddb612e90e25d512bc502e4aea189ce Mon Sep 17 00:00:00 2001 From: askazakov Date: Tue, 4 Jul 2023 13:52:52 +0500 Subject: [PATCH 6/6] fix copy paste --- templates/install-from-source.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/install-from-source.sh b/templates/install-from-source.sh index 999d6564a7..d33889da3d 100755 --- a/templates/install-from-source.sh +++ b/templates/install-from-source.sh @@ -1,4 +1,4 @@ -# Run only from the folder where the batch file is located! +# Run only from the folder where the shell script is located! dotnet build BenchmarkDotNet.Templates.csproj -c Release dotnet pack BenchmarkDotNet.Templates.csproj -c Release @@ -10,4 +10,4 @@ dotnet pack BenchmarkDotNet.Templates.csproj -c Release nupkg_path=$(find . -name "BenchmarkDotNet.Templates*.nupkg") dotnet new uninstall "BenchmarkDotNet.Templates" -dotnet new install $nupkg_path \ No newline at end of file +dotnet new install $nupkg_path