Skip to content

Commit

Permalink
* Multitarget Build for net40, net45, net451, net452, net46, netstand…
Browse files Browse the repository at this point in the history
…ard1.3, and netstandard2.0
  • Loading branch information
Greg Finzer committed Sep 27, 2018
1 parent e27fe2d commit e9d7c84
Show file tree
Hide file tree
Showing 42 changed files with 135 additions and 146 deletions.
4 changes: 2 additions & 2 deletions Compare-NET-Objects-Tests/BugTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using KellermanSoftware.CompareNetObjectsTests.TestClasses.Bal;
using Point = System.Drawing.Point;

#if !DNCORE
#if !NETSTANDARD
using System.Drawing.Drawing2D;
#endif

Expand Down Expand Up @@ -398,7 +398,7 @@ public void WilliamCWarnerTest()
Console.WriteLine(result.DifferencesString);
}

#if !DNCORE
#if !NETSTANDARD

[Test]
public void LinearGradient()
Expand Down
4 changes: 2 additions & 2 deletions Compare-NET-Objects-Tests/Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;

#if !DNCORE
#if !NETSTANDARD
using System.Windows.Forms;
#endif

Expand Down Expand Up @@ -69,7 +69,7 @@ public static string CurrentDir()
return AppDomain.CurrentDomain.BaseDirectory;
}

#if !DNCORE
#if !NETSTANDARD

/// <summary>
/// Takes a screen shot saves it to the specified directory and returns the full file path
Expand Down
2 changes: 1 addition & 1 deletion Compare-NET-Objects-Tests/Compare-NET-Objects-Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
<IsNetCore>true</IsNetCore>
<DefineConstants>$(DefineConstants);DNCORE</DefineConstants>
<DefineConstants>$(DefineConstants);DNCORE;NETSTANDARD;NETCORE</DefineConstants>
</PropertyGroup>

<ItemGroup Condition="!$(IsNetCore)">
Expand Down
2 changes: 1 addition & 1 deletion Compare-NET-Objects-Tests/CompareClassTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public void ShallowWithNullWithChanges()

#endregion

#if !DNCORE
#if !NETSTANDARD

#region Private Property Tests
[Test]
Expand Down
2 changes: 1 addition & 1 deletion Compare-NET-Objects-Tests/CompareDataColumnTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !DNCORE
#if !NETSTANDARD

using System.Data;
using KellermanSoftware.CompareNetObjects;
Expand Down
2 changes: 1 addition & 1 deletion Compare-NET-Objects-Tests/CompareDataRowTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !DNCORE
#if !NETSTANDARD

using System.Data;
using System.Diagnostics;
Expand Down
2 changes: 1 addition & 1 deletion Compare-NET-Objects-Tests/CompareDataTableTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !DNCORE
#if !NETSTANDARD

using System.Data;
using KellermanSoftware.CompareNetObjects;
Expand Down
2 changes: 1 addition & 1 deletion Compare-NET-Objects-Tests/CompareDatasetTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !DNCORE
#if !NETSTANDARD

using System.Data;
using KellermanSoftware.CompareNetObjects;
Expand Down
2 changes: 1 addition & 1 deletion Compare-NET-Objects-Tests/CompareFontTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !DNCORE
#if !NETSTANDARD

using System;
using System.Drawing;
Expand Down
2 changes: 1 addition & 1 deletion Compare-NET-Objects-Tests/CompareIListTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ public void TestEntityTreeNegative()
Console.WriteLine(result.DifferencesString);
Assert.IsFalse(result.AreEqual);

#if !DNCORE
#if !NETSTANDARD
Console.WriteLine(result.ElapsedMilliseconds);
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion Compare-NET-Objects-Tests/ConfigTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public void CaseInSensitiveTest()

#region Save and Load Configuration Tests

#if !DNCORE
#if !NETSTANDARD

[Test]
public void SaveConfigurationTest()
Expand Down
2 changes: 1 addition & 1 deletion Compare-NET-Objects-Tests/ReportTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !DNCORE
#if !NETSTANDARD

using System;
using System.Collections.Generic;
Expand Down
2 changes: 1 addition & 1 deletion Compare-NET-Objects-Tests/TestClasses/FontClass.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !DNCORE
#if !NETSTANDARD

using System.Drawing;

Expand Down
4 changes: 2 additions & 2 deletions Compare-NET-Objects/Cache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static IEnumerable<FieldInfo> GetFieldInfo(ComparisonConfig config, Type

FieldInfo[] currentFields;

#if !PORTABLE && !DNCORE
#if !NETSTANDARD
if (config.ComparePrivateFields && !config.CompareStaticFields)
{
List<FieldInfo> list = new List<FieldInfo>();
Expand Down Expand Up @@ -132,7 +132,7 @@ public static IEnumerable<PropertyInfo> GetPropertyInfo(ComparisonConfig config,

PropertyInfo[] currentProperties;

#if PORTABLE || DNCORE
#if NETSTANDARD
if (!config.CompareStaticProperties)
currentProperties = type.GetProperties(BindingFlags.Public | BindingFlags.Instance);
else
Expand Down
39 changes: 36 additions & 3 deletions Compare-NET-Objects/Compare-NET-Objects.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

<PropertyGroup>
<PackageId>CompareNETObjects</PackageId>
<TargetFrameworks>netstandard1.3;netstandard2.0;net40</TargetFrameworks>
<AssemblyTitle>Kellerman-Serialization</AssemblyTitle>
<AssemblyCompany>Kellerman Software</AssemblyCompany>
<AssemblyProduct>Kellerman-Serialization</AssemblyProduct>
<TargetFrameworks>net40;net45;net451;net452;net46;netstandard1.3;netstandard2.0;</TargetFrameworks>
<AssemblyName>KellermanSoftware.Compare-NET-Objects</AssemblyName>
<RootNamespace>KellermanSoftware.CompareNetObjects</RootNamespace>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand All @@ -13,6 +16,15 @@

<PropertyGroup>
<IsNetStandard>false</IsNetStandard>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageTags>compare comparison equality equal deep objects difference compareobjects deepequal deepequals</PackageTags>
<Description>What you have been waiting for. Perform a deep compare of any two .NET objects using reflection. Shows the differences between the two objects.</Description>
<Authors>KellermanSoftware</Authors>
<Version>4.56.0</Version>
<AssemblyVersion>4.56.0.0</AssemblyVersion>
<NeutralLanguage>en-US</NeutralLanguage>
<Company>Kellerman Software</Company>
<PackageReleaseNotes>Multitarget Build for net40, net45, net451, net452, net46, netstandard1.3, and netstandard2.0</PackageReleaseNotes>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">
Expand All @@ -24,12 +36,33 @@

<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<IsNetStandard>true</IsNetStandard>
<DefineConstants>$(DefineConstants);NETSTANDARD2_0</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="$(IsNetStandard)">
<DefineConstants>$(DefineConstants);DNCORE</DefineConstants>
<DefineConstants>$(DefineConstants);DNCORE;NETCORE;NETSTANDARD</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net40'">
<DefineConstants>$(DefineConstants);NET40;NETFULL</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net45'">
<DefineConstants>$(DefineConstants);NET45;NETFULL</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net451'">
<DefineConstants>$(DefineConstants);NET451;NETFULL</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net452'">
<DefineConstants>$(DefineConstants);NET452;NETFULL</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net46'">
<DefineConstants>$(DefineConstants);NET46;NETFULL</DefineConstants>
</PropertyGroup>

<ItemGroup>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
Expand All @@ -54,7 +87,7 @@
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net40'">
<ItemGroup Condition=" '$(IsNetStandard)' == 'false'">
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

Expand Down
14 changes: 7 additions & 7 deletions Compare-NET-Objects/CompareLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
using System.Collections.Generic;
using System.IO;

#if !DNCORE
#if !NETSTANDARD
using System.Runtime.Serialization.Json;
#endif

#if !PORTABLE && !DNCORE
#if !NETSTANDARD
using KellermanSoftware.CompareNetObjects.Properties;
#endif

Expand Down Expand Up @@ -143,7 +143,7 @@ public CompareLogic(ComparisonConfig config)
Config = config;
}

#if !PORTABLE && !DNCORE
#if !NETSTANDARD

/// <summary>
/// Set up defaults for the comparison
Expand Down Expand Up @@ -207,7 +207,7 @@ public ComparisonResult Compare(object object1, object object2)
{
ComparisonResult result = new ComparisonResult(Config);

#if !PORTABLE && !DNCORE
#if !NETSTANDARD
result.Watch.Start();
#endif

Expand All @@ -227,7 +227,7 @@ public ComparisonResult Compare(object object1, object object2)
if (Config.AutoClearCache)
ClearCache();

#if !PORTABLE && !DNCORE
#if !NETSTANDARD
result.Watch.Stop();
#endif

Expand All @@ -242,7 +242,7 @@ public void ClearCache()
Cache.ClearCache();
}

#if !DNCORE
#if !NETSTANDARD
/// <summary>
/// Save the current configuration to the passed stream
/// </summary>
Expand Down Expand Up @@ -270,7 +270,7 @@ public void LoadConfiguration(Stream stream)
}
#endif

#if !PORTABLE && !DNCORE
#if !NETSTANDARD
/// <summary>
/// Load the current configuration from a json stream
/// </summary>
Expand Down
6 changes: 3 additions & 3 deletions Compare-NET-Objects/CompareObjects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public CompareObjects()
_result = new ComparisonResult(_logic.Config);
}

#if !PORTABLE && !DNCORE
#if !NETSTANDARD
/// <summary>
/// Obsolete Use CompareLogic instead
/// </summary>
Expand All @@ -48,7 +48,7 @@ public CompareObjects(bool useAppConfigSettings)
#region Properties


#if !PORTABLE && !DNCORE
#if !NETSTANDARD
/// <summary>
/// Obsolete Use the ComparisonResult.ElapsedMilliseconds returned from CompareLogic.Compare
/// </summary>
Expand Down Expand Up @@ -90,7 +90,7 @@ public List<string> ElementsToInclude
}

//Security restriction in Silverlight prevents getting private properties and fields
#if !PORTABLE && !DNCORE
#if !NETSTANDARD

/// <summary>
/// Obsolete Use CompareLogic.Config.ComparePrivateProperties instead
Expand Down
Loading

0 comments on commit e9d7c84

Please sign in to comment.