Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Add .net standard support #197

Merged
merged 7 commits into from
Mar 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ var version = isTravis ? "0.0.1" : gitVersion.NuGetVersion;
var artifactsDir = Directory("./artifacts");
var outputDir = Directory("./build");

var dotnetFrameworks = IsRunningOnWindows() ? new [] { "net45", "net40" } : new string[] { };
var dotnetFrameworks = IsRunningOnWindows() ? new [] { "net45", "net40", "netstandard2.0" } : new string[] { };
// net35 can't be build by dotnet - https://github.com/Microsoft/msbuild/issues/1333
var msBuildFrameworks = IsRunningOnWindows() ? new [] { "net35" } : new [] { "net45", "net40", "net35" };
var msBuildFrameworks = IsRunningOnWindows() ? new [] { "net35" } : new [] { "net45", "net40", "net35", "netstandard2.0" };

var frameworks = dotnetFrameworks.Union(msBuildFrameworks).ToList();

Expand Down Expand Up @@ -127,7 +127,7 @@ Task("Test")
{
EnsureDirectoryExists(artifactsDir);

foreach(var framework in frameworks) {
foreach(var framework in frameworks.Where(x => x != "netstandard2.0")) {
var assemblies = GetFiles((outputDir + Directory(configuration) + Directory(framework)).ToString() + "/*.UnitTests.dll");
if (!assemblies.Any()) {
throw new FileNotFoundException("Could not find any test assemblies in: '" + configuration + "-" + framework + "'.");
Expand Down
5 changes: 4 additions & 1 deletion src/CommonConfigurations.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configurations>Debug;Release;Debug-net35;Release-net35;Debug-net40;Release-net40;Debug-net45;Release-net45</Configurations>
<Configurations>Debug;Release;Debug-net35;Release-net35;Debug-net40;Release-net40;Debug-net45;Release-net45;Release-netstandard2.0;Debug-netstandard2.0</Configurations>
<OutputPath>..\..\..\build\$(Configuration.Split("-")[0])</OutputPath>
<IntermediateOutputPath>..\..\..\build\obj\$(Configuration.Split("-")[0])\</IntermediateOutputPath>
</PropertyGroup>
Expand All @@ -15,4 +15,7 @@
<PropertyGroup Condition="'$(TargetFramework)' == 'net45'">
<DefineConstants>$(DefineConstants);net45</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<DefineConstants>$(DefineConstants);netstandard2.0</DefineConstants>
</PropertyGroup>
</Project>
14 changes: 13 additions & 1 deletion src/SharpRaven.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26730.12
VisualStudioVersion = 15.0.27004.2005
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpRaven", "app\SharpRaven\SharpRaven.csproj", "{CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}"
EndProject
Expand Down Expand Up @@ -49,10 +49,12 @@ Global
Debug-net35|Any CPU = Debug-net35|Any CPU
Debug-net40|Any CPU = Debug-net40|Any CPU
Debug-net45|Any CPU = Debug-net45|Any CPU
Debug-netstandard2.0|Any CPU = Debug-netstandard2.0|Any CPU
Release|Any CPU = Release|Any CPU
Release-net35|Any CPU = Release-net35|Any CPU
Release-net40|Any CPU = Release-net40|Any CPU
Release-net45|Any CPU = Release-net45|Any CPU
Release-netstandard2.0|Any CPU = Release-netstandard2.0|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Expand All @@ -63,6 +65,8 @@ Global
{CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug-net40|Any CPU.Build.0 = Debug-net40|Any CPU
{CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug-net45|Any CPU.ActiveCfg = Debug-net45|Any CPU
{CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug-net45|Any CPU.Build.0 = Debug-net45|Any CPU
{CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug-netstandard2.0|Any CPU.ActiveCfg = Debug-netstandard2.0|Any CPU
{CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug-netstandard2.0|Any CPU.Build.0 = Debug-netstandard2.0|Any CPU
{CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release|Any CPU.Build.0 = Release|Any CPU
{CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release-net35|Any CPU.ActiveCfg = Release-net35|Any CPU
Expand All @@ -71,6 +75,8 @@ Global
{CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release-net40|Any CPU.Build.0 = Release-net40|Any CPU
{CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release-net45|Any CPU.ActiveCfg = Release-net45|Any CPU
{CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release-net45|Any CPU.Build.0 = Release-net45|Any CPU
{CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release-netstandard2.0|Any CPU.ActiveCfg = Release-netstandard2.0|Any CPU
{CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release-netstandard2.0|Any CPU.Build.0 = Release-netstandard2.0|Any CPU
{E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug-net35|Any CPU.ActiveCfg = Debug-net35|Any CPU
Expand All @@ -79,6 +85,7 @@ Global
{E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug-net40|Any CPU.Build.0 = Debug-net40|Any CPU
{E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug-net45|Any CPU.ActiveCfg = Debug-net45|Any CPU
{E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug-net45|Any CPU.Build.0 = Debug-net45|Any CPU
{E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug-netstandard2.0|Any CPU.ActiveCfg = Debug-netstandard2.0|Any CPU
{E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release|Any CPU.Build.0 = Release|Any CPU
{E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release-net35|Any CPU.ActiveCfg = Release-net35|Any CPU
Expand All @@ -87,34 +94,39 @@ Global
{E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release-net40|Any CPU.Build.0 = Release-net40|Any CPU
{E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release-net45|Any CPU.ActiveCfg = Release-net45|Any CPU
{E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release-net45|Any CPU.Build.0 = Release-net45|Any CPU
{E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release-netstandard2.0|Any CPU.ActiveCfg = Release-netstandard2.0|Any CPU
{ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Debug-net35|Any CPU.ActiveCfg = Debug-net35|Any CPU
{ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Debug-net40|Any CPU.ActiveCfg = Debug-net40|Any CPU
{ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Debug-net40|Any CPU.Build.0 = Debug-net40|Any CPU
{ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Debug-net45|Any CPU.ActiveCfg = Debug-net45|Any CPU
{ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Debug-net45|Any CPU.Build.0 = Debug-net45|Any CPU
{ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Debug-netstandard2.0|Any CPU.ActiveCfg = Debug-netstandard2.0|Any CPU
{ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Release|Any CPU.Build.0 = Release|Any CPU
{ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Release-net35|Any CPU.ActiveCfg = Release-net35|Any CPU
{ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Release-net40|Any CPU.ActiveCfg = Release-net40|Any CPU
{ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Release-net40|Any CPU.Build.0 = Release-net40|Any CPU
{ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Release-net45|Any CPU.ActiveCfg = Release-net45|Any CPU
{ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Release-net45|Any CPU.Build.0 = Release-net45|Any CPU
{ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Release-netstandard2.0|Any CPU.ActiveCfg = Release-netstandard2.0|Any CPU
{7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Debug-net35|Any CPU.ActiveCfg = Debug-net35|Any CPU
{7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Debug-net40|Any CPU.ActiveCfg = Debug-net40|Any CPU
{7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Debug-net40|Any CPU.Build.0 = Debug-net40|Any CPU
{7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Debug-net45|Any CPU.ActiveCfg = Debug-net45|Any CPU
{7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Debug-net45|Any CPU.Build.0 = Debug-net45|Any CPU
{7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Debug-netstandard2.0|Any CPU.ActiveCfg = Debug-netstandard2.0|Any CPU
{7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Release|Any CPU.Build.0 = Release|Any CPU
{7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Release-net35|Any CPU.ActiveCfg = Release-net35|Any CPU
{7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Release-net40|Any CPU.ActiveCfg = Release-net40|Any CPU
{7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Release-net40|Any CPU.Build.0 = Release-net40|Any CPU
{7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Release-net45|Any CPU.ActiveCfg = Release-net45|Any CPU
{7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Release-net45|Any CPU.Build.0 = Release-net45|Any CPU
{7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Release-netstandard2.0|Any CPU.ActiveCfg = Release-netstandard2.0|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
9 changes: 6 additions & 3 deletions src/app/SharpRaven/SharpRaven.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net45;net40;net35</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net45;net40;net35</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Configurations>Debug;Release;Debug-net35;Release-net35;Debug-net40;Release-net40;Debug-net45;Release-net45;Release-netstandard2.0;Debug-netstandard2.0;Release-netstandard2.0</Configurations>
</PropertyGroup>

<Import Project="..\..\CommonConfigurations.targets" />

<ItemGroup Condition="'$(TargetFramework)' == 'net35' or '$(TargetFramework)' == 'net40' or '$(TargetFramework)' == 'net45'">
<Reference Include="System" />
<Reference Include="System.Configuration" />
<PackageReference Include="Newtonsoft.Json" Version="6.0.8" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net35'">
Expand All @@ -23,8 +25,9 @@
<Reference Include="System.Net.Http" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="6.0.8" />
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.4.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFrameworks>net45;net40</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Configurations>Debug;Release;Debug-net35;Release-net35;Debug-net40;Release-net40;Debug-net45;Release-net45;Release-netstandard2.0;Debug-netstandard2.0;Release-netstandard2.0</Configurations>
</PropertyGroup>

<Import Project="..\..\CommonConfigurations.targets" />
Expand Down