Skip to content

Commit e21373a

Browse files
committed
use Roslyn's managed API for compilation, drop .NET 4.0 support!! fixes #149
1 parent cc70cb1 commit e21373a

File tree

38 files changed

+116
-457
lines changed

38 files changed

+116
-457
lines changed

BenchmarkDotNet.Diagnostics.Windows/project.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
}
3333
},
3434
"frameworks": {
35-
"net40": { }
35+
"net45": { }
3636
},
3737
"dependencies": {
3838
"BenchmarkDotNet": {

BenchmarkDotNet.IntegrationTests.Classic/BenchmarkDotNet.IntegrationTests.Classic.csproj

+9-9
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@
3737
</PropertyGroup>
3838
<ItemGroup>
3939
<Reference Include="BenchmarkDotNet" Condition="'$(Configuration)'=='Release'">
40-
<HintPath>..\BenchmarkDotNet\bin\Release\net40\BenchmarkDotNet.dll</HintPath>
40+
<HintPath>..\BenchmarkDotNet\bin\Release\net45\BenchmarkDotNet.dll</HintPath>
4141
</Reference>
4242
<Reference Include="BenchmarkDotNet" Condition="'$(Configuration)'=='Debug'">
43-
<HintPath>..\BenchmarkDotNet\bin\Debug\net40\BenchmarkDotNet.dll</HintPath>
43+
<HintPath>..\BenchmarkDotNet\bin\Debug\net45\BenchmarkDotNet.dll</HintPath>
4444
</Reference>
4545
<Reference Include="System" />
4646
<Reference Include="System.Configuration" />
@@ -52,19 +52,19 @@
5252
<Reference Include="System.Net.Http" />
5353
<Reference Include="System.Xml" />
5454
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
55-
<HintPath>..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll</HintPath>
55+
<HintPath>..\packages\xunit.abstractions.2.0.1-rc2\lib\net35\xunit.abstractions.dll</HintPath>
5656
<Private>True</Private>
5757
</Reference>
58-
<Reference Include="xunit.assert, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
59-
<HintPath>..\packages\xunit.assert.2.1.0\lib\dotnet\xunit.assert.dll</HintPath>
58+
<Reference Include="xunit.assert, Version=2.2.0.3300, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
59+
<HintPath>..\packages\xunit.assert.2.2.0-beta2-build3300\lib\netstandard1.0\xunit.assert.dll</HintPath>
6060
<Private>True</Private>
6161
</Reference>
62-
<Reference Include="xunit.core, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
63-
<HintPath>..\packages\xunit.extensibility.core.2.1.0\lib\dotnet\xunit.core.dll</HintPath>
62+
<Reference Include="xunit.core, Version=2.2.0.3300, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
63+
<HintPath>..\packages\xunit.extensibility.core.2.2.0-beta2-build3300\lib\net45\xunit.core.dll</HintPath>
6464
<Private>True</Private>
6565
</Reference>
66-
<Reference Include="xunit.execution.desktop, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
67-
<HintPath>..\packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll</HintPath>
66+
<Reference Include="xunit.execution.desktop, Version=2.2.0.3300, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
67+
<HintPath>..\packages\xunit.extensibility.execution.2.2.0-beta2-build3300\lib\net45\xunit.execution.desktop.dll</HintPath>
6868
<Private>True</Private>
6969
</Reference>
7070
</ItemGroup>
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="xunit" version="2.1.0" targetFramework="net45" />
4-
<package id="xunit.abstractions" version="2.0.0" targetFramework="net45" />
5-
<package id="xunit.assert" version="2.1.0" targetFramework="net45" />
6-
<package id="xunit.core" version="2.1.0" targetFramework="net45" />
7-
<package id="xunit.extensibility.core" version="2.1.0" targetFramework="net45" />
8-
<package id="xunit.extensibility.execution" version="2.1.0" targetFramework="net45" />
9-
<package id="xunit.runner.console" version="2.1.0" targetFramework="net46" />
3+
<package id="xunit" version="2.2.0-beta2-build3300" targetFramework="net46" />
4+
<package id="xunit.abstractions" version="2.0.1-rc2" targetFramework="net46" />
5+
<package id="xunit.assert" version="2.2.0-beta2-build3300" targetFramework="net46" />
6+
<package id="xunit.core" version="2.2.0-beta2-build3300" targetFramework="net46" />
7+
<package id="xunit.extensibility.core" version="2.2.0-beta2-build3300" targetFramework="net46" />
8+
<package id="xunit.extensibility.execution" version="2.2.0-beta2-build3300" targetFramework="net46" />
9+
<package id="xunit.runner.console" version="2.2.0-beta2-build3300" targetFramework="net46" />
1010
</packages>

BenchmarkDotNet.IntegrationTests.CustomPaths/BenchmarkDotNet.IntegrationTests.CustomPaths.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232
</PropertyGroup>
3333
<ItemGroup>
3434
<Reference Include="BenchmarkDotNet" Condition="'$(Configuration)'=='Release'">
35-
<HintPath>..\BenchmarkDotNet\bin\Release\net40\BenchmarkDotNet.dll</HintPath>
35+
<HintPath>..\BenchmarkDotNet\bin\Release\net45\BenchmarkDotNet.dll</HintPath>
3636
</Reference>
3737
<Reference Include="BenchmarkDotNet" Condition="'$(Configuration)'=='Debug'">
38-
<HintPath>..\BenchmarkDotNet\bin\Debug\net40\BenchmarkDotNet.dll</HintPath>
38+
<HintPath>..\BenchmarkDotNet\bin\Debug\net45\BenchmarkDotNet.dll</HintPath>
3939
</Reference>
4040
<Reference Include="System" />
4141
<Reference Include="System.Core" />

BenchmarkDotNet.IntegrationTests.DifferentRuntime/BenchmarkDotNet.IntegrationTests.DifferentRuntime.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232
</PropertyGroup>
3333
<ItemGroup>
3434
<Reference Include="BenchmarkDotNet" Condition="'$(Configuration)'=='Release'">
35-
<HintPath>..\BenchmarkDotNet\bin\Release\net40\BenchmarkDotNet.dll</HintPath>
35+
<HintPath>..\BenchmarkDotNet\bin\Release\net45\BenchmarkDotNet.dll</HintPath>
3636
</Reference>
3737
<Reference Include="BenchmarkDotNet" Condition="'$(Configuration)'=='Debug'">
38-
<HintPath>..\BenchmarkDotNet\bin\Debug\net40\BenchmarkDotNet.dll</HintPath>
38+
<HintPath>..\BenchmarkDotNet\bin\Debug\net45\BenchmarkDotNet.dll</HintPath>
3939
</Reference>
4040
<Reference Include="System" />
4141
<Reference Include="System.Core" />

BenchmarkDotNet.IntegrationTests.DisabledOptimizations/BenchmarkDotNet.IntegrationTests.DisabledOptimizations.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
</PropertyGroup>
3232
<ItemGroup>
3333
<Reference Include="BenchmarkDotNet" Condition="'$(Configuration)'=='Release'">
34-
<HintPath>..\BenchmarkDotNet\bin\Release\net40\BenchmarkDotNet.dll</HintPath>
34+
<HintPath>..\BenchmarkDotNet\bin\Release\net45\BenchmarkDotNet.dll</HintPath>
3535
</Reference>
3636
<Reference Include="BenchmarkDotNet" Condition="'$(Configuration)'=='Debug'">
37-
<HintPath>..\BenchmarkDotNet\bin\Debug\net40\BenchmarkDotNet.dll</HintPath>
37+
<HintPath>..\BenchmarkDotNet\bin\Debug\net45\BenchmarkDotNet.dll</HintPath>
3838
</Reference>
3939
<Reference Include="System" />
4040
<Reference Include="System.Core" />

BenchmarkDotNet.IntegrationTests.EnabledOptimizations/BenchmarkDotNet.IntegrationTests.EnabledOptimizations.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
</PropertyGroup>
3737
<ItemGroup>
3838
<Reference Include="BenchmarkDotNet" Condition="'$(Configuration)'=='Release'">
39-
<HintPath>..\BenchmarkDotNet\bin\Release\net40\BenchmarkDotNet.dll</HintPath>
39+
<HintPath>..\BenchmarkDotNet\bin\Release\net45\BenchmarkDotNet.dll</HintPath>
4040
</Reference>
4141
<Reference Include="BenchmarkDotNet" Condition="'$(Configuration)'=='Debug'">
42-
<HintPath>..\BenchmarkDotNet\bin\Debug\net40\BenchmarkDotNet.dll</HintPath>
42+
<HintPath>..\BenchmarkDotNet\bin\Debug\net45\BenchmarkDotNet.dll</HintPath>
4343
</Reference>
4444
<Reference Include="System" />
4545
<Reference Include="System.Core" />

BenchmarkDotNet.IntegrationTests.FSharp/BenchmarkDotNet.IntegrationTests.FSharp.fsproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@
6868
</ItemGroup>
6969
<ItemGroup>
7070
<Reference Include="BenchmarkDotNet" Condition="'$(Configuration)'=='Release'">
71-
<HintPath>..\BenchmarkDotNet\bin\Release\net40\BenchmarkDotNet.dll</HintPath>
71+
<HintPath>..\BenchmarkDotNet\bin\Release\net45\BenchmarkDotNet.dll</HintPath>
7272
</Reference>
7373
<Reference Include="BenchmarkDotNet" Condition="'$(Configuration)'=='Debug'">
74-
<HintPath>..\BenchmarkDotNet\bin\Debug\net40\BenchmarkDotNet.dll</HintPath>
74+
<HintPath>..\BenchmarkDotNet\bin\Debug\net45\BenchmarkDotNet.dll</HintPath>
7575
</Reference>
7676
</ItemGroup>
7777
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

BenchmarkDotNet.IntegrationTests.VisualBasic/BenchmarkDotNet.IntegrationTests.VisualBasic.vbproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@
5353
</ItemGroup>
5454
<ItemGroup>
5555
<Reference Include="BenchmarkDotNet" Condition="'$(Configuration)'=='Release'">
56-
<HintPath>..\BenchmarkDotNet\bin\Release\net40\BenchmarkDotNet.dll</HintPath>
56+
<HintPath>..\BenchmarkDotNet\bin\Release\net45\BenchmarkDotNet.dll</HintPath>
5757
</Reference>
5858
<Reference Include="BenchmarkDotNet" Condition="'$(Configuration)'=='Debug'">
59-
<HintPath>..\BenchmarkDotNet\bin\Debug\net40\BenchmarkDotNet.dll</HintPath>
59+
<HintPath>..\BenchmarkDotNet\bin\Debug\net45\BenchmarkDotNet.dll</HintPath>
6060
</Reference>
6161
</ItemGroup>
6262
<ItemGroup>

BenchmarkDotNet.Samples.FSharp/BenchmarkDotNet.Samples.FSharp.fsproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@
5252
</ItemGroup>
5353
<ItemGroup>
5454
<Reference Include="BenchmarkDotNet" Condition="'$(Configuration)'=='Release'">
55-
<HintPath>..\BenchmarkDotNet\bin\Release\net40\BenchmarkDotNet.dll</HintPath>
55+
<HintPath>..\BenchmarkDotNet\bin\Release\net45\BenchmarkDotNet.dll</HintPath>
5656
</Reference>
5757
<Reference Include="BenchmarkDotNet" Condition="'$(Configuration)'=='Debug'">
58-
<HintPath>..\BenchmarkDotNet\bin\Debug\net40\BenchmarkDotNet.dll</HintPath>
58+
<HintPath>..\BenchmarkDotNet\bin\Debug\net45\BenchmarkDotNet.dll</HintPath>
5959
</Reference>
6060
</ItemGroup>
6161
<PropertyGroup>

BenchmarkDotNet.Samples/project.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@
2020
}
2121
},
2222
"frameworks": {
23-
"net40": {
23+
"net45": {
2424
"buildOptions": {
2525
"define": [ "CLASSIC" ]
2626
},
27-
"BenchmarkDotNet.Diagnostics.Windows": "1.0.0-*"
27+
"dependencies": {
28+
"BenchmarkDotNet.Diagnostics.Windows": {
29+
"target": "project"
30+
}
31+
}
2832
},
2933
"netcoreapp1.0": {
3034
"buildOptions": {
+3-13
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
using System;
2-
using System.Collections.Generic;
32
using System.IO;
43
using BenchmarkDotNet.Portability;
54

65
namespace BenchmarkDotNet.Helpers
76
{
8-
public static class ResourceHelper
7+
internal static class ResourceHelper
98
{
10-
public static string LoadTemplate(string name)
9+
internal static string LoadTemplate(string name)
1110
{
1211
var resourceName = "BenchmarkDotNet.Templates." + name;
1312
using (var stream = GetResouceStream(resourceName))
@@ -19,18 +18,9 @@ public static string LoadTemplate(string name)
1918
}
2019
}
2120

22-
public static Stream GetResouceStream(string resourceName)
21+
private static Stream GetResouceStream(string resourceName)
2322
{
2423
return typeof(ResourceHelper).Assembly().GetManifestResourceStream(resourceName);
2524
}
26-
27-
public static IEnumerable<string> GetAllResources(string prefix)
28-
{
29-
var assembly = typeof(ResourceHelper).Assembly();
30-
31-
foreach (var resourceName in assembly.GetManifestResourceNames())
32-
if (resourceName.StartsWith(prefix, StringComparison.Ordinal))
33-
yield return resourceName;
34-
}
3525
}
3626
}

BenchmarkDotNet/Helpers/StreamHelper.cs

-15
This file was deleted.
Binary file not shown.

BenchmarkDotNet/Roslyn/Microsoft.CSharp.Core.targets

-143
This file was deleted.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-1.92 MB
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)