Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Suppot for .net 5 so we can remove Microsoft.Extensions.DependencyModel 1.1.0 #14

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
[assembly: AssemblyFileVersion("7.1.15.0")]
[assembly: AssemblyInformationalVersion("7.1.15-SNAPSHOT")]

#if !NETSTANDARD2_0
#if !NETSTANDARD2_0 && !NET5_0
[assembly: NUnit.Framework.Timeout(300000)]
#endif
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup Label="Configuration">
<SignAssembly>True</SignAssembly>
<DelaySign>False</DelaySign>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net40</TargetFrameworks>
<TargetFrameworks>net5.0;netcoreapp2.0;net40</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net40' ">
<OutputType>library</OutputType>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<OutputType>library</OutputType>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
<OutputType>Library</OutputType>
<DefineConstants>NETSTANDARD2_0</DefineConstants>
Expand Down Expand Up @@ -45,12 +48,8 @@
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
<PackageReference Include="Microsoft.NET.Test.Sdk">
<Version>15.0.0</Version>
</PackageReference>
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation">
<Version>4.3.0</Version>
</PackageReference>
<ItemGroup Condition="'$(TargetFramework)' != 'net40'">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion itext.tests/itext.forms.tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
[assembly: AssemblyFileVersion("7.1.15.0")]
[assembly: AssemblyInformationalVersion("7.1.15-SNAPSHOT")]

#if !NETSTANDARD2_0
#if !NETSTANDARD2_0 && !NET5_0
[assembly: NUnit.Framework.Timeout(300000)]
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net40</TargetFrameworks>
<TargetFrameworks>net5.0;netcoreapp2.0;net40</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net40' ">
<OutputType>library</OutputType>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<OutputType>library</OutputType>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
<OutputType>Library</OutputType>
<DefineConstants>NETSTANDARD2_0</DefineConstants>
Expand Down Expand Up @@ -49,12 +52,8 @@
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
<PackageReference Include="Microsoft.NET.Test.Sdk">
<Version>15.0.0</Version>
</PackageReference>
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation">
<Version>4.3.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' != 'net40'">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public virtual void XfaExternalFileTest() {
String outFileName = destinationFolder + "outXfaExternalFile.pdf";
String cmpFileName = sourceFolder + "cmp_outXfaExternalFile.pdf";

#if NETSTANDARD2_0
#if NETSTANDARD2_0 || NET5_0
using (PdfDocument pdfDoc = new PdfDocument(new PdfReader(inFileName), new PdfWriter(outFileName).SetCompressionLevel
(CompressionConstants.NO_COMPRESSION))) {
NUnit.Framework.Assert.That(() =>
Expand Down Expand Up @@ -98,7 +98,7 @@ public virtual void XfaExternalConnectionTest() {
String outFileName = destinationFolder + "outXfaExternalConnection.pdf";
String cmpFileName = sourceFolder + "cmp_outXfaExternalConnection.pdf";

#if NETSTANDARD2_0
#if NETSTANDARD2_0 || NET5_0
using (PdfDocument pdfDoc = new PdfDocument(new PdfReader(inFileName), new PdfWriter(outFileName).SetCompressionLevel
(CompressionConstants.NO_COMPRESSION))) {
NUnit.Framework.Assert.That(() =>
Expand Down
2 changes: 1 addition & 1 deletion itext.tests/itext.io.tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
[assembly: AssemblyFileVersion("7.1.15.0")]
[assembly: AssemblyInformationalVersion("7.1.15-SNAPSHOT")]

#if !NETSTANDARD2_0
#if !NETSTANDARD2_0 && !NET5_0
[assembly: NUnit.Framework.Timeout(300000)]
#endif
10 changes: 9 additions & 1 deletion itext.tests/itext.io.tests/itext.io.tests.netstandard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net40</TargetFrameworks>
<TargetFrameworks>net5.0;netcoreapp2.0;net40</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net40' ">
<OutputType>library</OutputType>
Expand Down Expand Up @@ -52,6 +52,14 @@
<Version>4.3.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
<PackageReference Include="Microsoft.NET.Test.Sdk">
<Version>15.0.0</Version>
</PackageReference>
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation">
<Version>4.3.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion itext.tests/itext.kernel.tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
[assembly: AssemblyFileVersion("7.1.15.0")]
[assembly: AssemblyInformationalVersion("7.1.15-SNAPSHOT")]

#if !NETSTANDARD2_0
#if !NETSTANDARD2_0 && !NET5_0
[assembly: NUnit.Framework.Timeout(300000)]
#endif
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup Label="Configuration">
<SignAssembly>True</SignAssembly>
<DelaySign>False</DelaySign>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net40</TargetFrameworks>
<TargetFrameworks>net5.0;netcoreapp2.0;net40</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net40' ">
<OutputType>library</OutputType>
Expand Down
18 changes: 9 additions & 9 deletions itext.tests/itext.kernel.tests/itext/kernel/pdf/PdfReaderTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ public virtual void IncorrectXrefSizeInTrailerAppend() {
document.Close();
}

#if !NETSTANDARD2_0
#if !NETSTANDARD2_0 && !NET5_0 && !NET5_0
[NUnit.Framework.Timeout(1000)]
#endif // !NETSTANDARD2_0
[NUnit.Framework.Test]
Expand All @@ -1213,7 +1213,7 @@ public virtual void StreamLengthCorrection1() {
}
}

#if !NETSTANDARD2_0
#if !NETSTANDARD2_0 && !NET5_0
[NUnit.Framework.Timeout(1000)]
#endif // !NETSTANDARD2_0
[NUnit.Framework.Test]
Expand All @@ -1230,7 +1230,7 @@ public virtual void StreamLengthCorrection2() {
}
}

#if !NETSTANDARD2_0
#if !NETSTANDARD2_0 && !NET5_0
[NUnit.Framework.Timeout(1000)]
#endif // !NETSTANDARD2_0
[NUnit.Framework.Test]
Expand All @@ -1247,7 +1247,7 @@ public virtual void StreamLengthCorrection3() {
}
}

#if !NETSTANDARD2_0
#if !NETSTANDARD2_0 && !NET5_0
[NUnit.Framework.Timeout(1000)]
#endif // !NETSTANDARD2_0
[NUnit.Framework.Test]
Expand All @@ -1264,7 +1264,7 @@ public virtual void StreamLengthCorrection4() {
}
}

#if !NETSTANDARD2_0
#if !NETSTANDARD2_0 && !NET5_0
[NUnit.Framework.Timeout(1000)]
#endif // !NETSTANDARD2_0
[NUnit.Framework.Test]
Expand All @@ -1281,7 +1281,7 @@ public virtual void StreamLengthCorrection5() {
}
}

#if !NETSTANDARD2_0
#if !NETSTANDARD2_0 && !NET5_0
[NUnit.Framework.Timeout(1000)]
#endif // !NETSTANDARD2_0
[NUnit.Framework.Test]
Expand All @@ -1298,7 +1298,7 @@ public virtual void StreamLengthCorrection6() {
}
}

#if !NETSTANDARD2_0
#if !NETSTANDARD2_0 && !NET5_0
[NUnit.Framework.Timeout(1000)]
#endif // !NETSTANDARD2_0
[NUnit.Framework.Test]
Expand All @@ -1315,7 +1315,7 @@ public virtual void StreamLengthCorrection7() {
}
}

#if !NETSTANDARD2_0
#if !NETSTANDARD2_0 && !NET5_0
[NUnit.Framework.Timeout(1000)]
#endif // !NETSTANDARD2_0
[NUnit.Framework.Test]
Expand All @@ -1332,7 +1332,7 @@ public virtual void StreamLengthCorrection8() {
}
}

#if !NETSTANDARD2_0
#if !NETSTANDARD2_0 && !NET5_0
[NUnit.Framework.Timeout(1000)]
#endif // !NETSTANDARD2_0
[NUnit.Framework.Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ source product.
*/

// System.Drawing doesn't exist within .netcoreapp
#if !NETSTANDARD2_0
#if !NETSTANDARD2_0 && !NET5_0

using iText.Kernel.Font;
using iText.Kernel.Pdf.Canvas;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class XMPMetaParserTest : ExtendedITextTest {
+ " \n"
+ " \n" + "<?xpacket end=\"w\"?>";

#if !NETSTANDARD2_0
#if !NETSTANDARD2_0 && !NET5_0
[NUnit.Framework.Test]
public virtual void XxeTestFromString() {
String metadataToParse = MessageFormatUtil.Format(XMP_WITH_XXE, XXE_FILE_PATH);
Expand All @@ -76,7 +76,7 @@ public virtual void XxeTestFromString() {
}
#endif // NETSTANDARD2_0

#if !NETSTANDARD2_0
#if !NETSTANDARD2_0 && !NET5_0
[NUnit.Framework.Test]
public virtual void XxeTestFromByteBuffer() {
String metadataToParse = MessageFormatUtil.Format(XMP_WITH_XXE, XXE_FILE_PATH);
Expand All @@ -99,7 +99,7 @@ public virtual void XxeTestFromByteBuffer() {
}
#endif // NETSTANDARD2_0

#if !NETSTANDARD2_0
#if !NETSTANDARD2_0 && !NET5_0
[NUnit.Framework.Test]
public virtual void XxeTestFromInputStream() {
String metadataToParse = MessageFormatUtil.Format(XMP_WITH_XXE, XXE_FILE_PATH);
Expand Down
2 changes: 1 addition & 1 deletion itext/itext.barcodes/itext.barcodes.netstandard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net40</TargetFrameworks>
<TargetFrameworks>net5.0;netstandard2.0;net40</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
<OutputType>library</OutputType>
Expand Down
2 changes: 1 addition & 1 deletion itext/itext.barcodes/itext/barcodes/BarcodesExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public static byte[] GetBytes(this String str) {
}

public static Assembly GetAssembly(this Type type) {
#if !NETSTANDARD2_0
#if !NETSTANDARD2_0 && !NET5_0
return type.Assembly;
#else
return type.GetTypeInfo().Assembly;
Expand Down
2 changes: 1 addition & 1 deletion itext/itext.font-asian/itext.font-asian.netstandard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net40</TargetFrameworks>
<TargetFrameworks>net5.0;netstandard2.0;net40</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
<OutputType>library</OutputType>
Expand Down
2 changes: 1 addition & 1 deletion itext/itext.forms/itext.forms.netstandard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net40</TargetFrameworks>
<TargetFrameworks>net5.0;netstandard2.0;net40</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
<OutputType>library</OutputType>
Expand Down
2 changes: 1 addition & 1 deletion itext/itext.forms/itext/forms/FormsExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public static void Write(this Stream stream, byte[] buffer) {

public static Assembly GetAssembly(this Type type)
{
#if !NETSTANDARD2_0
#if !NETSTANDARD2_0 && !NET5_0
return type.Assembly;
#else
return type.GetTypeInfo().Assembly;
Expand Down
2 changes: 1 addition & 1 deletion itext/itext.hyph/itext.hyph.netstandard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net40</TargetFrameworks>
<TargetFrameworks>net5.0;netstandard2.0;net40</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
<OutputType>library</OutputType>
Expand Down
6 changes: 3 additions & 3 deletions itext/itext.io/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@

[assembly: Guid("39631ecb-1d39-4eb2-b775-37bd34cbf5a4")]

[assembly: AssemblyVersion("7.1.15.0")]
[assembly: AssemblyFileVersion("7.1.15.0")]
[assembly: AssemblyInformationalVersion("7.1.15-SNAPSHOT")]
[assembly: AssemblyVersion("7.2.0.0")]
[assembly: AssemblyFileVersion("7.2.0.0")]
[assembly: AssemblyInformationalVersion("7.2.0-SNAPSHOT")]
11 changes: 7 additions & 4 deletions itext/itext.io/itext.io.netstandard.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup Label="Configuration">
<SignAssembly>True</SignAssembly>
<DelaySign>False</DelaySign>
<DocumentationFile>$(TargetDir)bin\$(Configuration)\$(TargetFramework)\itext.io.xml</DocumentationFile>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net40</TargetFrameworks>
<TargetFrameworks>net5.0;netstandard2.0;net40</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
<OutputType>library</OutputType>
Expand Down Expand Up @@ -81,9 +81,12 @@
<PackageReference Include="System.Globalization.Extensions" Version="4.3.0" />
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
<PackageReference Include="System.Diagnostics.Process" Version="4.3.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="1.1.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.3.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="1.1.9" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="5.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Common.Logging" Version="3.4.1" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion itext/itext.io/itext/io/IOExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public static T[] ToArray<T>(this ICollection<T> col) {
}

public static Assembly GetAssembly(this Type type) {
#if !NETSTANDARD2_0
#if !NETSTANDARD2_0 && !NET5_0
return type.Assembly;
#else
return type.GetTypeInfo().Assembly;
Expand Down
2 changes: 1 addition & 1 deletion itext/itext.io/itext/io/font/AdobeGlyphList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static AdobeGlyphList() {
MemoryStream stream = new MemoryStream();
while (true) {
int size = resource.Read(buf);
if (size < 0) {
if (size <= 0) {
break;
}
stream.Write(buf, 0, size);
Expand Down
2 changes: 1 addition & 1 deletion itext/itext.io/itext/io/font/Type1Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public virtual RandomAccessFileOrArray GetMetricsFile() {
}
MemoryStream stream = new MemoryStream();
int read;
while ((read = resource.Read(buf)) >= 0) {
while ((read = resource.Read(buf)) > 0) {
stream.Write(buf, 0, read);
}
buf = stream.ToArray();
Expand Down
Loading