Skip to content

Commit

Permalink
Add NET8 support and Set Version to 6.0.0. Fix #135
Browse files Browse the repository at this point in the history
  • Loading branch information
LiorBanai committed Nov 15, 2023
1 parent 4321b4e commit 2f5fd1c
Show file tree
Hide file tree
Showing 55 changed files with 303 additions and 247 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,9 @@ dotnet_diagnostic.MA0044.severity = error
dotnet_diagnostic.MA0052.severity = error
dotnet_diagnostic.SA1139.severity = error
dotnet_diagnostic.SA1316.severity = error
dotnet_diagnostic.SA1204.severity = none
dotnet_diagnostic.SA1623.severity = silent
dotnet_diagnostic.SA1615.severity = silent

[*.{cs,vb}]
dotnet_style_operator_placement_when_wrapping = beginning_of_line
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
</ItemGroup>
Expand Down
5 changes: 1 addition & 4 deletions Analogy.Interfaces.UnitTests/AnalogyInterfaceUnitTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public void TestAnalogyLogMessageIsNotNull()
Assert.IsNotNull(message.MethodName);
Assert.IsNotNull(message.Module);
Assert.IsNotNull(message.User);

}
[TestMethod]
public void TestAdditionalProperties()
Expand All @@ -25,8 +24,6 @@ public void TestAdditionalProperties()
message.AddOrReplaceAdditionalProperty("test", "test");
Assert.IsNotNull(message.AdditionalProperties.Count == 1);
Assert.IsNotNull(message.AdditionalProperties["test"] == "test");


}
public void TestAnalogyMessagesTypes()
{
Expand All @@ -37,4 +34,4 @@ public void TestAnalogyMessagesTypes()
IAnalogyLogMessage m5 = new AnalogyCriticalMessage("text", "Source");
}
}
}
}
2 changes: 2 additions & 0 deletions Analogy.Interfaces.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{62E073E4-94B9-4988-9FBB-5E43EE641028}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
Directory.Build.props = Directory.Build.props
.github\workflows\dotnetcore.yml = .github\workflows\dotnetcore.yml
EndProjectSection
EndProject
Global
Expand Down
34 changes: 5 additions & 29 deletions Analogy.Interfaces/Analogy.Interfaces.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">

<PropertyGroup>
<TargetFrameworks>net7.0-windows;net6.0-windows;net48;net471</TargetFrameworks>
<TargetFrameworks>net8.0-windows;net7.0-windows;net6.0-windows;net48;net471</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
Expand All @@ -15,12 +15,12 @@
<AssemblyName>Analogy.Interfaces</AssemblyName>
<RootNamespace>Analogy.Interfaces</RootNamespace>
<PackageId>Analogy.LogViewer.Interfaces</PackageId>
<VersionPrefix>5.0.3.0</VersionPrefix>
<VersionPrefix>6.0.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<Authors>Lior Banai</Authors>
<Product>Analogy.LogViewer.Interfaces</Product>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Copyright>Lior Banai @ 2018-2023</Copyright>
<Copyright>Lior Banai @ 2018-2024</Copyright>
<PackageIcon>icon.png</PackageIcon>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
Expand All @@ -30,16 +30,6 @@
<Company>Analogy.LogViewer</Company>
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net471|AnyCPU'">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net471|AnyCPU'">
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<ItemGroup>
<None Include="..\icon.png">
<Pack>True</Pack>
Expand All @@ -48,21 +38,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Build.Tasks.Git" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Resources.Extensions" Version="7.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net48' or '$(TargetFramework)' == 'net471' ">
<PackageReference Include="PolySharp" Version="1.13.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="System.Resources.Extensions" Version="8.0.0" />
</ItemGroup>
</Project>
14 changes: 7 additions & 7 deletions Analogy.Interfaces/AnalogyLogMessageCustomEqualityComparer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public bool Equals(IAnalogyLogMessage? x, IAnalogyLogMessage? y)
return false;
}

if (CompareText && ((x.Text is not null && y.Text is null) || x.Text is null && y.Text is not null) ||
if ((CompareText && ((x.Text is not null && y.Text is null) || (x.Text is null && y.Text is not null))) ||
((x.Text is not null && y.Text is not null) && !x.Text.Equals(y.Text)))
{
return false;
Expand Down Expand Up @@ -99,12 +99,12 @@ public bool Equals(IAnalogyLogMessage? x, IAnalogyLogMessage? y)
}
if (CompareParameters)
{
if (x.AdditionalProperties is null && y.AdditionalProperties != null ||
x.AdditionalProperties != null && y.AdditionalProperties is null)
if ((x.AdditionalProperties is null && y.AdditionalProperties != null) ||
(x.AdditionalProperties != null && y.AdditionalProperties is null))
{
return false;
}
return x.AdditionalProperties is null && y.AdditionalProperties is null ||
return (x.AdditionalProperties is null && y.AdditionalProperties is null) ||
x.AdditionalProperties.SequenceEqual(y.AdditionalProperties);

Check warning on line 108 in Analogy.Interfaces/AnalogyLogMessageCustomEqualityComparer.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Possible null reference argument for parameter 'first' in 'bool Enumerable.SequenceEqual<KeyValuePair<string, string>>(IEnumerable<KeyValuePair<string, string>> first, IEnumerable<KeyValuePair<string, string>> second)'.

Check warning on line 108 in Analogy.Interfaces/AnalogyLogMessageCustomEqualityComparer.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Possible null reference argument for parameter 'first' in 'bool Enumerable.SequenceEqual<KeyValuePair<string, string>>(IEnumerable<KeyValuePair<string, string>> first, IEnumerable<KeyValuePair<string, string>> second)'.

Check warning on line 108 in Analogy.Interfaces/AnalogyLogMessageCustomEqualityComparer.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Possible null reference argument for parameter 'first' in 'bool Enumerable.SequenceEqual<KeyValuePair<string, string>>(IEnumerable<KeyValuePair<string, string>> first, IEnumerable<KeyValuePair<string, string>> second)'.

Check warning on line 108 in Analogy.Interfaces/AnalogyLogMessageCustomEqualityComparer.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Possible null reference argument for parameter 'second' in 'bool Enumerable.SequenceEqual<KeyValuePair<string, string>>(IEnumerable<KeyValuePair<string, string>> first, IEnumerable<KeyValuePair<string, string>> second)'.

Check warning on line 108 in Analogy.Interfaces/AnalogyLogMessageCustomEqualityComparer.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

Possible null reference argument for parameter 'first' in 'bool Enumerable.SequenceEqual<KeyValuePair<string, string>>(IEnumerable<KeyValuePair<string, string>> first, IEnumerable<KeyValuePair<string, string>> second)'.

Check warning on line 108 in Analogy.Interfaces/AnalogyLogMessageCustomEqualityComparer.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

Possible null reference argument for parameter 'second' in 'bool Enumerable.SequenceEqual<KeyValuePair<string, string>>(IEnumerable<KeyValuePair<string, string>> first, IEnumerable<KeyValuePair<string, string>> second)'.
}

Expand Down Expand Up @@ -142,7 +142,7 @@ public int GetHashCode(IAnalogyLogMessage obj)
hashCode = (hashCode * 397) ^ (obj.FileName != null ? obj.FileName.GetHashCode() : 0);
}
if (CompareLineNumber)
{ hashCode = (hashCode * 397) ^ (int) obj.LineNumber; }
{ hashCode = (hashCode * 397) ^ (int)obj.LineNumber; }

if (CompareClass)
{
Expand Down Expand Up @@ -170,7 +170,7 @@ public int GetHashCode(IAnalogyLogMessage obj)
}
if (CompareParameters)
{
if (obj.AdditionalProperties != null && obj.AdditionalProperties.Any())
if (obj.AdditionalProperties is { Count: > 0 })
{
foreach (var parameter in obj.AdditionalProperties)
{
Expand All @@ -187,4 +187,4 @@ public int GetHashCode(IAnalogyLogMessage obj)
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Analogy.Interfaces
{
Expand All @@ -25,7 +22,6 @@ public class AnalogyLogMessageCustomEqualityOptedInComparer : IEqualityComparer<

public AnalogyLogMessageCustomEqualityOptedInComparer()
{

}

public AnalogyLogMessageCustomEqualityOptedInComparer(bool compareDate, bool compareId, bool compareText,
Expand Down Expand Up @@ -71,7 +67,7 @@ public bool Equals(IAnalogyLogMessage? x, IAnalogyLogMessage? y)
return false;
}

if (CompareText && ((x.Text is not null && y.Text is null) || x.Text is null && y.Text is not null) ||
if ((CompareText && ((x.Text is not null && y.Text is null) || (x.Text is null && y.Text is not null))) ||
((x.Text is not null && y.Text is not null) && !x.Text.Equals(y.Text)))
{
return false;
Expand Down Expand Up @@ -128,12 +124,12 @@ public bool Equals(IAnalogyLogMessage? x, IAnalogyLogMessage? y)
}
if (CompareParameters)
{
if (x.AdditionalProperties is null && y.AdditionalProperties != null ||
x.AdditionalProperties != null && y.AdditionalProperties is null)
if ((x.AdditionalProperties is null && y.AdditionalProperties != null) ||
(x.AdditionalProperties != null && y.AdditionalProperties is null))
{
return false;
}
return x.AdditionalProperties is null && y.AdditionalProperties is null ||
return (x.AdditionalProperties is null && y.AdditionalProperties is null) ||
x.AdditionalProperties.SequenceEqual(y.AdditionalProperties);

Check warning on line 133 in Analogy.Interfaces/AnalogyLogMessageCustomEqualityOptedInComparer.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Possible null reference argument for parameter 'first' in 'bool Enumerable.SequenceEqual<KeyValuePair<string, string>>(IEnumerable<KeyValuePair<string, string>> first, IEnumerable<KeyValuePair<string, string>> second)'.

Check warning on line 133 in Analogy.Interfaces/AnalogyLogMessageCustomEqualityOptedInComparer.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Possible null reference argument for parameter 'first' in 'bool Enumerable.SequenceEqual<KeyValuePair<string, string>>(IEnumerable<KeyValuePair<string, string>> first, IEnumerable<KeyValuePair<string, string>> second)'.

Check warning on line 133 in Analogy.Interfaces/AnalogyLogMessageCustomEqualityOptedInComparer.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Possible null reference argument for parameter 'second' in 'bool Enumerable.SequenceEqual<KeyValuePair<string, string>>(IEnumerable<KeyValuePair<string, string>> first, IEnumerable<KeyValuePair<string, string>> second)'.

Check warning on line 133 in Analogy.Interfaces/AnalogyLogMessageCustomEqualityOptedInComparer.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Possible null reference argument for parameter 'second' in 'bool Enumerable.SequenceEqual<KeyValuePair<string, string>>(IEnumerable<KeyValuePair<string, string>> first, IEnumerable<KeyValuePair<string, string>> second)'.

Check warning on line 133 in Analogy.Interfaces/AnalogyLogMessageCustomEqualityOptedInComparer.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Possible null reference argument for parameter 'first' in 'bool Enumerable.SequenceEqual<KeyValuePair<string, string>>(IEnumerable<KeyValuePair<string, string>> first, IEnumerable<KeyValuePair<string, string>> second)'.

Check warning on line 133 in Analogy.Interfaces/AnalogyLogMessageCustomEqualityOptedInComparer.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Possible null reference argument for parameter 'second' in 'bool Enumerable.SequenceEqual<KeyValuePair<string, string>>(IEnumerable<KeyValuePair<string, string>> first, IEnumerable<KeyValuePair<string, string>> second)'.

Check warning on line 133 in Analogy.Interfaces/AnalogyLogMessageCustomEqualityOptedInComparer.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

Possible null reference argument for parameter 'first' in 'bool Enumerable.SequenceEqual<KeyValuePair<string, string>>(IEnumerable<KeyValuePair<string, string>> first, IEnumerable<KeyValuePair<string, string>> second)'.

Check warning on line 133 in Analogy.Interfaces/AnalogyLogMessageCustomEqualityOptedInComparer.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

Possible null reference argument for parameter 'second' in 'bool Enumerable.SequenceEqual<KeyValuePair<string, string>>(IEnumerable<KeyValuePair<string, string>> first, IEnumerable<KeyValuePair<string, string>> second)'.
}

Expand Down Expand Up @@ -199,7 +195,7 @@ public int GetHashCode(IAnalogyLogMessage obj)
}
if (CompareParameters)
{
if (obj.AdditionalProperties != null && obj.AdditionalProperties.Any())
if (obj.AdditionalProperties != null && obj.AdditionalProperties.Count > 0)
{
foreach (var parameter in obj.AdditionalProperties)
{
Expand All @@ -216,4 +212,4 @@ public int GetHashCode(IAnalogyLogMessage obj)
}
}
}
}
}
11 changes: 2 additions & 9 deletions Analogy.Interfaces/DataTypes/AnalogyColumnFilter.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Analogy.Interfaces.DataTypes
namespace Analogy.Interfaces.DataTypes
{
public struct AnalogyColumnFilter
{
public string ColumnName { get; set; }
public string FilterValue { get; set; }
public AnalogyColumnFilterType FilterType { get; set; }

}
}
}
2 changes: 1 addition & 1 deletion Analogy.Interfaces/DataTypes/AnalogyColumnInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ public AnalogyColumnInfo(string columnCaption, string columnName, Type columnTyp
ColumnType = columnType;
}
}
}
}
5 changes: 4 additions & 1 deletion Analogy.Interfaces/DataTypes/AnalogyFileReadProgress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
public struct AnalogyFileReadProgress
{
public AnalogyFileReadProgressType ProgressType { get; }

/// <summary>
///Number of items processed in this report (normally one message per report).
/// </summary>
public long TotalProcessedInThisReport { get; }

/// <summary>
///Total processed entries (lines or messages)
/// </summary>
public long TotalProcessed { get; }

/// <summary>
///Total entries (lines or messages) in file
/// </summary>
Expand All @@ -24,4 +27,4 @@ public AnalogyFileReadProgress(AnalogyFileReadProgressType progressType, long to
TotalProcessedInThisReport = totalProcessedInThisReport;
}
}
}
}
Loading

0 comments on commit 2f5fd1c

Please sign in to comment.