Last active
August 26, 2019 13:48
-
-
Save adamsitnik/f151dc68ea30f8138cfc55d81195f363 to your computer and use it in GitHub Desktop.
How to compare local changes vs nuget package using single BDN config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk"> | |
<!-- IMPORTANT! MSBuild sets the Optimize=true only if the Configuration name == Release --> | |
<PropertyGroup Condition="$(Configuration.StartsWith('Release'))"> | |
<Optimize>true</Optimize> | |
</PropertyGroup> | |
<ItemGroup Condition=" '$(Configuration)' == 'Release' Or '$(Configuration)' == 'Debug' "> | |
<ProjectReference Include="SomeProject.csproj" /> | |
</ItemGroup> | |
<ItemGroup Condition=" '$(Configuration)' == 'ReleasePackage' Or '$(Configuration)' == 'DebugPackage' "> | |
<PackageReference Include="SomePackage" Version="2.2.4" /> | |
</ItemGroup> | |
</Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using BenchmarkDotNet.Configs; | |
using BenchmarkDotNet.Jobs; | |
using BenchmarkDotNet.Running; | |
namespace BenchmarkDotNet.Samples | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var config = DefaultConfig.Instance | |
.With(Job.Default.WithId("Project")) | |
.With(Job.Default.WithCustomBuildConfiguration("ReleasePackage").WithId("Package")); // BDN is going to do --configuration ReleasePackage for all dotnet cli commands | |
BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args, config); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment