Skip to content

Commit

Permalink
upgrade NPOI to 2.6.2 and support net472
Browse files Browse the repository at this point in the history
  • Loading branch information
donnytian committed Sep 17, 2023
1 parent cc34425 commit 65c9dce
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 24 deletions.
10 changes: 5 additions & 5 deletions Npoi.Mapper/src/Npoi.Mapper/Npoi.Mapper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
<Authors>Donny Tian</Authors>
<AssemblyName>Npoi.Mapper</AssemblyName>
<PackageId>Npoi.Mapper</PackageId>
<PackageTags>Excel;XLS;XLSX;NPOI;Object mapping;dynamic</PackageTags>
<PackageTags>Excel;XLS;XLSX;NPOI;object mapping;dynamic object mapping</PackageTags>
<PackageProjectUrl>https://donnytian.github.io/Npoi.Mapper/</PackageProjectUrl>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Version>6.0</Version>
<PackageReleaseNotes>Target on net6.0 only</PackageReleaseNotes>
<Version>6.1</Version>
<PackageReleaseNotes>Support net 472 and net60</PackageReleaseNotes>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>npoi.mapper.snk</AssemblyOriginatorKeyFile>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net472;net6.0</TargetFrameworks>
<LangVersion>default</LangVersion>
</PropertyGroup>

Expand All @@ -30,7 +30,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NPOI" Version="2.6.0" />
<PackageReference Include="NPOI" Version="2.6.2" />
</ItemGroup>

<ItemGroup Label="SourceLink">
Expand Down
1 change: 0 additions & 1 deletion Npoi.Mapper/test/ExportGeneralTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.IO;
using System.Linq;
using Npoi.Mapper;
using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel;
using NUnit.Framework;
Expand Down
1 change: 0 additions & 1 deletion Npoi.Mapper/test/Extensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using NUnit.Framework;

namespace test
{
Expand Down
7 changes: 3 additions & 4 deletions Npoi.Mapper/test/ImportDynamicTests.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Npoi.Mapper;
using NPOI.SS.UserModel;
using NUnit.Framework;
Expand Down Expand Up @@ -275,7 +272,9 @@ public void TakeDynamic_TwoSheets_WithSameHeaderName()
Assert.AreEqual(stringValue, objs1[0].Value.A);
Assert.AreEqual(intValue, objs1[0].Value.sheet1B);
Assert.AreEqual(doubleValue, objs2[0].Value.A);
Assert.AreEqual(dateTimeValue.ToOADate(), objs2[0].Value.sheet2B);
var diff = dateTimeValue.ToOADate() - objs2[0].Value.sheet2B;
const double epsilon = 0.0000000001;
Assert.IsTrue(Math.Abs(diff) < epsilon);
}
}
}
1 change: 0 additions & 1 deletion Npoi.Mapper/test/ImportGeneralTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Globalization;
using System.IO;
using System.Linq;
using NPOI.HSSF.UserModel;
using Npoi.Mapper;
using Npoi.Mapper.Attributes;
using NPOI.SS.UserModel;
Expand Down
3 changes: 0 additions & 3 deletions Npoi.Mapper/test/TestSetUp.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using System;
using System.Diagnostics.CodeAnalysis;
using NUnit.Framework;

[assembly:ExcludeFromCodeCoverage]

namespace test
{
/// <summary>
Expand Down
13 changes: 4 additions & 9 deletions Npoi.Mapper/test/test.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net472;net6.0</TargetFrameworks>
<LangVersion>default</LangVersion>
</PropertyGroup>

Expand All @@ -16,7 +16,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0-preview-23424-02" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0">
<PrivateAssets>all</PrivateAssets>
Expand All @@ -28,12 +28,7 @@
<ProjectReference Include="..\src\Npoi.Mapper\Npoi.Mapper.csproj" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net45'">
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.ComponentModel.DataAnnotations" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net40'">
<ItemGroup Condition=" '$(TargetFramework)' == 'net472'">
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.ComponentModel.DataAnnotations" />
</ItemGroup>
Expand All @@ -42,7 +37,7 @@
<PackageReference Include="System.Reflection.Emit" Version="4.3.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
</ItemGroup>

<ItemGroup>
<None Update="Book1.xlsx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
Expand Down

0 comments on commit 65c9dce

Please sign in to comment.