mirror of
https://github.com/cyanfish/naps2.git
synced 2024-09-11 15:26:55 +03:00
Add multi-build for NET6 (as well as 4.6.1)
Tests pass & FDesktop shows.
This commit is contained in:
parent
177e77cfc5
commit
5a9a949e9d
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net461</TargetFramework>
|
||||
<TargetFrameworks>net6-windows;net461</TargetFrameworks>
|
||||
<OutputType>Exe</OutputType>
|
||||
<LargeAddressAware>true</LargeAddressAware>
|
||||
<RootNamespace>NAPS2.Console</RootNamespace>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net461</TargetFramework>
|
||||
<TargetFrameworks>net6;net461</TargetFrameworks>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>NAPS2.Portable</RootNamespace>
|
||||
<AssemblyName>NAPS2.Portable</AssemblyName>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net461</TargetFramework>
|
||||
<TargetFrameworks>net6-windows;net461</TargetFrameworks>
|
||||
<OutputType>Exe</OutputType>
|
||||
<LargeAddressAware>true</LargeAddressAware>
|
||||
<RootNamespace>NAPS2.Server</RootNamespace>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net461</TargetFramework>
|
||||
<TargetFrameworks>net6-windows;net461</TargetFrameworks>
|
||||
<OutputType>Exe</OutputType>
|
||||
<LargeAddressAware>true</LargeAddressAware>
|
||||
<RootNamespace>NAPS2</RootNamespace>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net461</TargetFramework>
|
||||
<TargetFrameworks>net6-windows;net461</TargetFrameworks>
|
||||
<OutputType>Exe</OutputType>
|
||||
<LargeAddressAware>true</LargeAddressAware>
|
||||
<RootNamespace>NAPS2.Worker</RootNamespace>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net461;netcoreapp2.1;netstandard2.0</TargetFrameworks>
|
||||
<TargetFrameworks>net6;net461;netcoreapp2.1;netstandard2.0</TargetFrameworks>
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<RootNamespace>NAPS2.Images.Gdi</RootNamespace>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net461;netcoreapp2.1;netstandard2.0</TargetFrameworks>
|
||||
<TargetFrameworks>net6;net461;netcoreapp2.1;netstandard2.0</TargetFrameworks>
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<RootNamespace>NAPS2.Images</RootNamespace>
|
||||
|
@ -1,8 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net461</TargetFramework>
|
||||
<TargetFrameworks>net6-windows;net461</TargetFrameworks>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<RootNamespace>NAPS2</RootNamespace>
|
||||
|
||||
<Title>NAPS2 (Not Another PDF Scanner 2)</Title>
|
||||
@ -16,7 +17,7 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\NAPS2.Sdk\NAPS2.Sdk.csproj" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<PackageReference Include="Ninject" Version="3.2.2" />
|
||||
<PackageReference Include="Ninject" Version="3.3.6" />
|
||||
<PackageReference Include="NLog" Version="4.5.8" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -16,7 +16,7 @@ public static class StaticConfiguration
|
||||
Log.EventLogger = new WindowsEventLogger(config);
|
||||
}
|
||||
#if DEBUG
|
||||
Debug.Listeners.Add(new NLogTraceListener());
|
||||
Trace.Listeners.Add(new NLogTraceListener());
|
||||
#endif
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net461</TargetFramework>
|
||||
<TargetFrameworks>net6-windows;net461</TargetFrameworks>
|
||||
<Nullable>enable</Nullable>
|
||||
<RootNamespace>NAPS2</RootNamespace>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net472</TargetFramework>
|
||||
<TargetFrameworks>net6-windows;net461</TargetFrameworks>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
@ -15,6 +15,10 @@
|
||||
<ProjectReference Include="..\NAPS2.Sdk.Tests\NAPS2.Sdk.Tests.csproj" />
|
||||
<ProjectReference Include="..\NAPS2.Lib.WinForms\NAPS2.Lib.WinForms.csproj" />
|
||||
<ProjectReference Include="..\NAPS2.Lib.Console\NAPS2.Lib.Console.csproj" />
|
||||
|
||||
<PackageReference Include="Moq" Version="4.18.1" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net461</TargetFramework>
|
||||
<TargetFrameworks>net6-windows;net461</TargetFrameworks>
|
||||
<RootNamespace>NAPS2</RootNamespace>
|
||||
|
||||
<Title>NAPS2 (Not Another PDF Scanner 2)</Title>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net461</TargetFramework>
|
||||
<TargetFrameworks>net6;net461</TargetFrameworks>
|
||||
<RootNamespace>NAPS2.Remoting.Network.Tests</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net461</TargetFramework>
|
||||
<TargetFrameworks>net6;net461</TargetFrameworks>
|
||||
<Nullable>enable</Nullable>
|
||||
<RootNamespace>NAPS2.Remoting.Network</RootNamespace>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net461</TargetFramework>
|
||||
<TargetFrameworks>net6;net461</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="..\NAPS2.Setup\CommonTargets.targets" />
|
||||
|
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net472</TargetFramework>
|
||||
<TargetFrameworks>net6-windows;net461</TargetFrameworks>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using NAPS2.Ocr;
|
||||
using NAPS2.Scan;
|
||||
@ -21,6 +22,7 @@ public class PdfSharpExporter : PdfExporter
|
||||
{
|
||||
GlobalFontSettings.FontResolver = new UnixFontResolver();
|
||||
}
|
||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||
}
|
||||
|
||||
public PdfSharpExporter(ScanningContext scanningContext)
|
||||
|
@ -1,12 +1,11 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using NAPS2.Unmanaged;
|
||||
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
namespace NAPS2.ImportExport.Pdf;
|
||||
|
||||
public class PdfiumNativeLibrary : NativeLibrary
|
||||
public class PdfiumNativeLibrary : Unmanaged.NativeLibrary
|
||||
{
|
||||
// TODO: Consider using Pdfium as a full replacement for PdfSharp.
|
||||
// The benefits would be more import compatibility + a solution to PdfSharp xplat. But there may be some
|
||||
|
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net461</TargetFramework>
|
||||
<TargetFrameworks>net6;net461</TargetFrameworks>
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<RootNamespace>NAPS2</RootNamespace>
|
||||
@ -54,10 +54,15 @@
|
||||
<PackageReference Include="NAPS2.Wia" Version="1.0.1" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
|
||||
<PackageReference Include="Nullable" Version="1.2.0" />
|
||||
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
|
||||
<PackageReference Include="System.Collections.Immutable" Version="5.0.0" />
|
||||
<PackageReference Include="System.Resources.Extensions" Version="6.0.0" />
|
||||
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="6.0.0" />
|
||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0" />
|
||||
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="4.11.0" />
|
||||
<PackageReference Include="System.ValueTuple" Version="4.3.1" />
|
||||
<PackageReference Include="ZXing.Net" Version="0.16.4" />
|
||||
<PackageReference Include="ZXing.Net" Version="0.16.8" />
|
||||
<PackageReference Include="ZXing.Net.Bindings.Windows.Compatibility" Version="0.16.10" Condition="'$(TargetFramework)' != 'net461'" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -1,6 +1,9 @@
|
||||
using NAPS2.Images.Gdi;
|
||||
using ZXing;
|
||||
using ZXing.Common;
|
||||
#if !NETFRAMEWORK
|
||||
using ZXing.Windows.Compatibility;
|
||||
#endif
|
||||
|
||||
namespace NAPS2.Scan;
|
||||
|
||||
@ -30,6 +33,7 @@ public static class BarcodeDetector
|
||||
TryHarder = true,
|
||||
PossibleFormats = options.PatchTOnly ? new List<BarcodeFormat> { PATCH_T_FORMAT } : null
|
||||
};
|
||||
// TODO: Needs to be non-windows-specific
|
||||
var reader = new BarcodeReader { Options = zxingOptions };
|
||||
return new BarcodeDetection(true, reader.Decode(gdiImage.Bitmap));
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ namespace NAPS2.Util;
|
||||
|
||||
public static class CollectionExtensions
|
||||
{
|
||||
#if !NETCOREAPP3_0 && !NET471_OR_GREATER
|
||||
#if !NETCOREAPP3_0_OR_GREATER && !NET471_OR_GREATER
|
||||
/// <summary>
|
||||
/// Appends the given item to the end of the enumerable.
|
||||
/// </summary>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net461</TargetFramework>
|
||||
<TargetFrameworks>net6;net461</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="..\NAPS2.Setup\CommonTargets.targets" />
|
||||
|
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net461</TargetFramework>
|
||||
<TargetFrameworks>net6;net461</TargetFrameworks>
|
||||
<Nullable>enable</Nullable>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>NAPS2.Localization</RootNamespace>
|
||||
|
Loading…
Reference in New Issue
Block a user