Skip to content

Commit 89575d3

Browse files
authored
Merge pull request #19 from kmorcinek/master
Migrate Core project to .NET Standard 1.0
2 parents 8bb0ba4 + 59d4822 commit 89575d3

6 files changed

+28
-62
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace System.Diagnostics.CodeAnalysis
2+
{
3+
/// <summary>Specifies that the attributed code should be excluded from code coverage information. </summary>
4+
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Event, AllowMultiple = false, Inherited = false)]
5+
public sealed class ExcludeFromCodeCoverageAttribute : Attribute
6+
{
7+
}
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System;
2+
using System.Reflection;
3+
4+
namespace Synergy.Contracts.Extensions
5+
{
6+
internal static class TypeExtensions
7+
{
8+
public static bool IsInstanceOfType(this Type type, object obj)
9+
{
10+
return obj != null && type.GetTypeInfo().IsAssignableFrom(obj.GetType().GetTypeInfo());
11+
}
12+
}
13+
}

Synergy.Contracts/Failures/DesignByContractViolationException.cs

-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using System.Diagnostics;
3-
using System.Runtime.Serialization;
43
using JetBrains.Annotations;
54

65
namespace Synergy.Contracts
@@ -9,7 +8,6 @@ namespace Synergy.Contracts
98
/// The exception thrown when some contract check failed.
109
/// When you see it it means that someone does not meet the contract.
1110
/// </summary>
12-
[Serializable]
1311
[DebuggerStepThrough]
1412
public class DesignByContractViolationException : Exception
1513
{
@@ -27,13 +25,5 @@ public DesignByContractViolationException()
2725
public DesignByContractViolationException([NotNull] string message) : base(message)
2826
{
2927
}
30-
31-
/// <summary>
32-
/// Serialization required constructor.
33-
/// </summary>
34-
protected DesignByContractViolationException([NotNull] SerializationInfo info, StreamingContext context) :
35-
base(info, context)
36-
{
37-
}
3828
}
3929
}

Synergy.Contracts/Failures/FailCastable.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Diagnostics.CodeAnalysis;
33
using JetBrains.Annotations;
4+
using Synergy.Contracts.Extensions;
45

56
namespace Synergy.Contracts
67
{
+6-48
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1+
<Project Sdk="Microsoft.NET.Sdk">
42
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{653FF172-0DC5-4D81-91AE-3CE09D8CF7C1}</ProjectGuid>
8-
<OutputType>Library</OutputType>
9-
<AppDesignerFolder>Properties</AppDesignerFolder>
10-
<RootNamespace>Synergy.Contracts</RootNamespace>
3+
<TargetFramework>netstandard1.0</TargetFramework>
114
<AssemblyName>Synergy.Contracts</AssemblyName>
12-
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
13-
<FileAlignment>512</FileAlignment>
5+
<RootNamespace>Synergy.Contracts</RootNamespace>
6+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
147
</PropertyGroup>
158
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
169
<DebugSymbols>true</DebugSymbols>
@@ -35,42 +28,7 @@
3528
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
3629
</PropertyGroup>
3730
<ItemGroup>
38-
<Reference Include="JetBrains.Annotations, Version=10.2.1.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
39-
<HintPath>..\packages\JetBrains.Annotations.10.2.1\lib\net\JetBrains.Annotations.dll</HintPath>
40-
<Private>True</Private>
41-
</Reference>
42-
<Reference Include="System" />
43-
<Reference Include="System.Core" />
44-
</ItemGroup>
45-
<ItemGroup>
46-
<Compile Include="..\SynergyAssemblyInfo.cs">
47-
<Link>Properties\SynergyAssemblyInfo.cs</Link>
48-
</Compile>
49-
<Compile Include="Extensions\StringFormatExtensions.cs" />
50-
<Compile Include="Failures\DesignByContractViolationException.cs" />
51-
<Compile Include="Failures\Fail.cs" />
52-
<Compile Include="Failures\FailEnum.cs" />
53-
<Compile Include="Failures\FailString.cs" />
54-
<Compile Include="Failures\FailBoolean.cs" />
55-
<Compile Include="Failures\FailCastable.cs" />
56-
<Compile Include="Failures\FailCollection.cs" />
57-
<Compile Include="Failures\FailDateTime.cs" />
58-
<Compile Include="Failures\FailEquality.cs" />
59-
<Compile Include="Failures\FailGuid.cs" />
60-
<Compile Include="Failures\FailNullability.cs" />
61-
<Compile Include="Pooling\Pool.cs" />
62-
<Compile Include="Properties\AssemblyInfo.cs" />
63-
</ItemGroup>
64-
<ItemGroup>
65-
<None Include="packages.config" />
66-
<None Include="Synergy.Contracts.nuspec" />
31+
<PackageReference Include="Microsoft.NETCore.Portable.Compatibility" Version="1.0.1" />
32+
<PackageReference Include="JetBrains.Annotations" Version="10.2.1" />
6733
</ItemGroup>
68-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
69-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
70-
Other similar extension points exist, see Microsoft.Common.targets.
71-
<Target Name="BeforeBuild">
72-
</Target>
73-
<Target Name="AfterBuild">
74-
</Target>
75-
-->
7634
</Project>

Synergy.Contracts/packages.config

-4
This file was deleted.

0 commit comments

Comments
 (0)