From 65ca4d7478d35dd03ecbbac51d538e31d5f8a089 Mon Sep 17 00:00:00 2001 From: airhawk777 <75365275+airhawk777@users.noreply.github.com> Date: Tue, 8 Dec 2020 19:10:34 +1100 Subject: [PATCH] Update to .NET 5 (#10346) * Update to .NET 5 .NET 5 brings many performance (especially regex) improvements https://devblogs.microsoft.com/dotnet/announcing-net-5-0/ Can look at bringing the packages upto date and using a single file executable in a future PR if the maintainers are interested * Dotnet restore before building * Restore on Windows only * Out of ideas * Update framework for windows specific apps * Don't upgrade Microsoft.Extensions.Configuration * drop mono from the dotnet linux build instructions * Fix logic to get app runtime * readme: add windows .net prereq link * Update README.md * azure-pipeline: bump minorversion to 17 Co-authored-by: garfield69 Co-authored-by: Diego Heras Co-authored-by: ilike2burnthing <59480337+ilike2burnthing@users.noreply.github.com> --- README.md | 27 ++++++++++--------- azure-pipelines.yml | 10 +++---- src/Jackett.Common/Jackett.Common.csproj | 6 ++--- src/Jackett.Common/Utils/DotNetCoreUtil.cs | 5 ++-- .../Jackett.IntegrationTests.csproj | 4 +-- src/Jackett.Server/Jackett.Server.csproj | 23 ++++++++-------- src/Jackett.Service/Jackett.Service.csproj | 2 +- src/Jackett.Test/Jackett.Test.csproj | 10 +++---- src/Jackett.Tray/Jackett.Tray.csproj | 4 +-- src/Jackett.Updater/Jackett.Updater.csproj | 2 +- src/Jackett.sln | 1 + 11 files changed, 49 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index b92604a9e..c09b71004 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ A third-party Golang SDK for Jackett is available from [webtor-io/go-jackett](ht #### Supported Systems * Windows 7SP1 or greater -* Linux [supported operating systems here](https://github.com/dotnet/core/blob/master/release-notes/3.1/3.1-supported-os.md#linux) +* Linux [supported operating systems here](https://github.com/dotnet/core/blob/master/release-notes/5.0/5.0-supported-os.md#linux) * macOS 10.13 or greater
Supported Public Trackers @@ -587,12 +587,13 @@ We recommend you install Jackett as a Windows service using the supplied install To get started with using the installer for Jackett, follow the steps below: -1. Download the latest version of the Windows installer, "Jackett.Installer.Windows.exe" from the [releases](https://github.com/Jackett/Jackett/releases/latest) page. -2. When prompted if you would like this app to make changes to your computer, select "yes". -3. If you would like to install Jackett as a Windows Service, make sure the "Install as Windows Service" checkbox is filled. -4. Once the installation has finished, check the "Launch Jackett" box to get started. -5. Navigate your web browser to http://127.0.0.1:9117 -6. You're now ready to begin adding your trackers and using Jackett. +1. Check if you need any .NET prerequisites installed, see https://docs.microsoft.com/en-us/dotnet/core/install/windows?tabs=net50#dependencies +2. Download the latest version of the Windows installer, "Jackett.Installer.Windows.exe" from the [releases](https://github.com/Jackett/Jackett/releases/latest) page. +3. When prompted if you would like this app to make changes to your computer, select "yes". +4. If you would like to install Jackett as a Windows Service, make sure the "Install as Windows Service" checkbox is filled. +5. Once the installation has finished, check the "Launch Jackett" box to get started. +6. Navigate your web browser to http://127.0.0.1:9117 +7. You're now ready to begin adding your trackers and using Jackett. When installed as a service the tray icon acts as a way to open/start/stop Jackett. If you opted to not install it as a service then Jackett will run its web server from the tray tool. @@ -756,7 +757,7 @@ To use it, please just request a free API key on [OMDb](http://www.omdbapi.com/a ## Building from source ### Windows -* Install the .NET Core [SDK](https://www.microsoft.com/net/download/windows) +* Install the .NET 5 [SDK](https://www.microsoft.com/net/download/windows) * Clone Jackett * Open PowerShell and from the `src` directory, run `dotnet restore` * Open the Jackett solution in Visual Studio 2019 (version 16.4 or above) @@ -776,21 +777,21 @@ git clone https://github.com/Jackett/Jackett.git cd Jackett/src # dotnet core version -dotnet publish Jackett.Server -f netcoreapp3.1 --self-contained -r osx-x64 -c Debug # takes care of everything -./Jackett.Server/bin/Debug/netcoreapp3.1/osx-x64/jackett # run jackett +dotnet publish Jackett.Server -f net5.0 --self-contained -r osx-x64 -c Debug # takes care of everything +./Jackett.Server/bin/Debug/net5.0/osx-x64/jackett # run jackett ``` ### Linux ```bash -sudo apt install mono-complete nuget msbuild dotnet-sdk-3.1 # install build tools (Debian/ubuntu) +sudo apt install nuget msbuild dotnet-sdk-5.0 # install build tools (Debian/ubuntu) git clone https://github.com/Jackett/Jackett.git cd Jackett/src # dotnet core version -dotnet publish Jackett.Server -f netcoreapp3.1 --self-contained -r linux-x64 -c Debug # takes care of everything -./Jackett.Server/bin/Debug/netcoreapp3.1/linux-x64/jackett # run jackett +dotnet publish Jackett.Server -f net5.0 --self-contained -r linux-x64 -c Debug # takes care of everything +./Jackett.Server/bin/Debug/net5.0/linux-x64/jackett # run jackett ``` ## Screenshots diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8ffaa9391..128e86a03 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,12 +2,12 @@ name: $(majorVersion).$(minorVersion).$(patchVersion) variables: majorVersion: 0 - minorVersion: 16 + minorVersion: 17 patchVersion: $[counter(variables['minorVersion'], 1)] # this will reset when we bump minor jackettVersion: $(majorVersion).$(minorVersion).$(patchVersion) buildConfiguration: Release - netCoreFramework: netcoreapp3.1 - netCoreSdkVersion: 3.1.x + netCoreFramework: net5.0 + netCoreSdkVersion: 5.0.x # system.debug: true trigger: @@ -110,7 +110,7 @@ stages: projects: 'src/Jackett.Tray/Jackett.Tray.csproj' publishWebProjects: false zipAfterPublish: false - arguments: '--configuration $(buildConfiguration) --runtime $(runtime) --framework $(framework) --output $(Build.BinariesDirectory) /p:AssemblyVersion=$(jackettVersion) /p:FileVersion=$(jackettVersion) /p:InformationalVersion=$(jackettVersion) /p:Version=$(jackettVersion)' + arguments: '--configuration $(buildConfiguration) --runtime $(runtime) --framework $(framework)-windows --output $(Build.BinariesDirectory) /p:AssemblyVersion=$(jackettVersion) /p:FileVersion=$(jackettVersion) /p:InformationalVersion=$(jackettVersion) /p:Version=$(jackettVersion)' - task: DotNetCoreCLI@2 displayName: Build Jackett Service (Windows only) @@ -120,7 +120,7 @@ stages: projects: 'src/Jackett.Service/Jackett.Service.csproj' publishWebProjects: false zipAfterPublish: false - arguments: '--configuration $(buildConfiguration) --runtime $(runtime) --framework $(framework) --output $(Build.BinariesDirectory) /p:AssemblyVersion=$(jackettVersion) /p:FileVersion=$(jackettVersion) /p:InformationalVersion=$(jackettVersion) /p:Version=$(jackettVersion)' + arguments: '--configuration $(buildConfiguration) --runtime $(runtime) --framework $(framework)-windows --output $(Build.BinariesDirectory) /p:AssemblyVersion=$(jackettVersion) /p:FileVersion=$(jackettVersion) /p:InformationalVersion=$(jackettVersion) /p:Version=$(jackettVersion)' - task: CopyFiles@2 displayName: Copy Jackett Server diff --git a/src/Jackett.Common/Jackett.Common.csproj b/src/Jackett.Common/Jackett.Common.csproj index ec9610dc9..82b26ad1f 100644 --- a/src/Jackett.Common/Jackett.Common.csproj +++ b/src/Jackett.Common/Jackett.Common.csproj @@ -22,10 +22,10 @@ - + - - + + diff --git a/src/Jackett.Common/Utils/DotNetCoreUtil.cs b/src/Jackett.Common/Utils/DotNetCoreUtil.cs index a585ff069..1edf6c849 100644 --- a/src/Jackett.Common/Utils/DotNetCoreUtil.cs +++ b/src/Jackett.Common/Utils/DotNetCoreUtil.cs @@ -1,5 +1,6 @@ using System; -using System.Runtime.InteropServices; +using System.Reflection; +using System.Runtime.Versioning; namespace Jackett.Common.Utils { @@ -13,7 +14,7 @@ namespace Jackett.Common.Utils try { - runningOnDotNetCore = RuntimeInformation.FrameworkDescription.IndexOf("core", StringComparison.OrdinalIgnoreCase) >= 0; + runningOnDotNetCore = Assembly.GetEntryAssembly()?.GetCustomAttribute()?.FrameworkName.IndexOf("Core", StringComparison.OrdinalIgnoreCase) >= 0; } catch { diff --git a/src/Jackett.IntegrationTests/Jackett.IntegrationTests.csproj b/src/Jackett.IntegrationTests/Jackett.IntegrationTests.csproj index 9ee050270..04ca67187 100644 --- a/src/Jackett.IntegrationTests/Jackett.IntegrationTests.csproj +++ b/src/Jackett.IntegrationTests/Jackett.IntegrationTests.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net5.0 false false @@ -9,7 +9,7 @@ - + diff --git a/src/Jackett.Server/Jackett.Server.csproj b/src/Jackett.Server/Jackett.Server.csproj index 3ad40b526..4fe3c15aa 100644 --- a/src/Jackett.Server/Jackett.Server.csproj +++ b/src/Jackett.Server/Jackett.Server.csproj @@ -1,19 +1,19 @@ - netcoreapp3.1;net461 + net5.0;net461 jackett.ico Exe false - + false - + false @@ -31,11 +31,12 @@ - - + + - - + + + @@ -47,6 +48,7 @@ + @@ -55,11 +57,10 @@ - - + - - + + diff --git a/src/Jackett.Service/Jackett.Service.csproj b/src/Jackett.Service/Jackett.Service.csproj index be4264023..205a02661 100644 --- a/src/Jackett.Service/Jackett.Service.csproj +++ b/src/Jackett.Service/Jackett.Service.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net5.0-windows WinExe JackettService jackett.ico diff --git a/src/Jackett.Test/Jackett.Test.csproj b/src/Jackett.Test/Jackett.Test.csproj index ea8fa1bdb..4ec16b6ed 100644 --- a/src/Jackett.Test/Jackett.Test.csproj +++ b/src/Jackett.Test/Jackett.Test.csproj @@ -1,7 +1,7 @@ - + - netcoreapp3.1;net461 + net5.0;net461 false @@ -25,14 +25,14 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - + diff --git a/src/Jackett.Tray/Jackett.Tray.csproj b/src/Jackett.Tray/Jackett.Tray.csproj index 53b900537..33b8f1eb2 100644 --- a/src/Jackett.Tray/Jackett.Tray.csproj +++ b/src/Jackett.Tray/Jackett.Tray.csproj @@ -1,7 +1,7 @@ - + - netcoreapp3.1 + net5.0-windows WinExe true JackettTray diff --git a/src/Jackett.Updater/Jackett.Updater.csproj b/src/Jackett.Updater/Jackett.Updater.csproj index 9021f4fd1..9d6b6d502 100644 --- a/src/Jackett.Updater/Jackett.Updater.csproj +++ b/src/Jackett.Updater/Jackett.Updater.csproj @@ -1,7 +1,7 @@ - net461;netcoreapp3.1 + net461;net5.0 jackett.ico JackettUpdater Exe diff --git a/src/Jackett.sln b/src/Jackett.sln index a988c8eeb..83a535790 100644 --- a/src/Jackett.sln +++ b/src/Jackett.sln @@ -5,6 +5,7 @@ MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{BE7B0C8A-6144-47CD-821E-B09BA1B7BADE}" ProjectSection(SolutionItems) = preProject ..\.editorconfig = ..\.editorconfig + ..\azure-pipelines.yml = ..\azure-pipelines.yml ..\Installer.iss = ..\Installer.iss ..\LICENSE = ..\LICENSE ..\README.md = ..\README.md