From 69cfe1845bc4b52de0222e5ff3c5ae39316e36d8 Mon Sep 17 00:00:00 2001 From: Alexey Golub Date: Thu, 26 Sep 2019 20:06:35 +0300 Subject: [PATCH] Migrate to .NET Core 3 --- Deploy/Prepare.ps1 | 49 +++-- .../DiscordChatExporter.Cli.csproj | 8 +- .../DiscordChatExporter.Core.Markdown.csproj | 5 +- .../DiscordChatExporter.Core.Models.csproj | 5 +- .../DiscordChatExporter.Core.Rendering.csproj | 3 +- .../DiscordChatExporter.Core.Services.csproj | 5 +- .../DiscordChatExporter.Gui.csproj | 172 +++--------------- .../Properties/AssemblyInfo.cs | 7 - .../Properties/Resources.Designer.cs | 63 ------- .../Properties/Resources.resx | 117 ------------ Dockerfile | 8 +- UpdateVersion.ps1 | 2 +- appveyor.yml | 8 +- 13 files changed, 82 insertions(+), 370 deletions(-) delete mode 100644 DiscordChatExporter.Gui/Properties/AssemblyInfo.cs delete mode 100644 DiscordChatExporter.Gui/Properties/Resources.Designer.cs delete mode 100644 DiscordChatExporter.Gui/Properties/Resources.resx diff --git a/Deploy/Prepare.ps1 b/Deploy/Prepare.ps1 index 4f694bf..c40fa13 100644 --- a/Deploy/Prepare.ps1 +++ b/Deploy/Prepare.ps1 @@ -1,21 +1,48 @@ -New-Item "$PSScriptRoot\Portable\bin" -ItemType Directory -Force +# -- GUI -- -# --- GUI --- +$licenseFilePath = "$PSScriptRoot/../License.txt" + +$projectDirPath = "$PSScriptRoot/../DiscordChatExporter.Gui" +$publishDirPath = "$PSScriptRoot/bin/build/" +$artifactFilePath = "$PSScriptRoot/bin/DiscordChatExporter.zip" + +# Prepare directory +if (Test-Path $publishDirPath) { + Remove-Item $publishDirPath -Recurse -Force +} +New-Item $publishDirPath -ItemType Directory -Force + +# Build & publish +dotnet publish $projectDirPath -o $publishDirPath -c Release | Out-Host -# Get files $files = @() -$files += Get-Item -Path "$PSScriptRoot\..\License.txt" -$files += Get-ChildItem -Path "$PSScriptRoot\..\DiscordChatExporter.Gui\bin\Release\*" -Include "*.exe", "*.dll", "*.config" +$files += Get-Item -Path $licenseFilePath +$files += Get-ChildItem -Path $publishDirPath # Pack into archive -$files | Compress-Archive -DestinationPath "$PSScriptRoot\Portable\bin\DiscordChatExporter.zip" -Force +$files | Compress-Archive -DestinationPath $artifactFilePath -Force + + +# -- CLI -- + +$licenseFilePath = "$PSScriptRoot/../License.txt" + +$projectDirPath = "$PSScriptRoot/../DiscordChatExporter.Cli" +$publishDirPath = "$PSScriptRoot/bin/build/" +$artifactFilePath = "$PSScriptRoot/bin/DiscordChatExporter.Cli.zip" + +# Prepare directory +if (Test-Path $publishDirPath) { + Remove-Item $publishDirPath -Recurse -Force +} +New-Item $publishDirPath -ItemType Directory -Force -# --- CLI --- +# Build & publish +dotnet publish $projectDirPath -o $publishDirPath -c Release | Out-Host -# Get files $files = @() -$files += Get-Item -Path "$PSScriptRoot\..\License.txt" -$files += Get-ChildItem -Path "$PSScriptRoot\..\DiscordChatExporter.Cli\bin\Release\net46\*" -Include "*.exe", "*.dll", "*.config" +$files += Get-Item -Path $licenseFilePath +$files += Get-ChildItem -Path $publishDirPath # Pack into archive -$files | Compress-Archive -DestinationPath "$PSScriptRoot\Portable\bin\DiscordChatExporter.CLI.zip" -Force \ No newline at end of file +$files | Compress-Archive -DestinationPath $artifactFilePath -Force \ No newline at end of file diff --git a/DiscordChatExporter.Cli/DiscordChatExporter.Cli.csproj b/DiscordChatExporter.Cli/DiscordChatExporter.Cli.csproj index d90cd49..8d447db 100644 --- a/DiscordChatExporter.Cli/DiscordChatExporter.Cli.csproj +++ b/DiscordChatExporter.Cli/DiscordChatExporter.Cli.csproj @@ -2,19 +2,17 @@ Exe - net46;netcoreapp2.1 + netcoreapp3.0 2.15 Tyrrrz Copyright (c) Alexey Golub ..\favicon.ico - true - latest - - + + diff --git a/DiscordChatExporter.Core.Markdown/DiscordChatExporter.Core.Markdown.csproj b/DiscordChatExporter.Core.Markdown/DiscordChatExporter.Core.Markdown.csproj index f5c9795..e7173b6 100644 --- a/DiscordChatExporter.Core.Markdown/DiscordChatExporter.Core.Markdown.csproj +++ b/DiscordChatExporter.Core.Markdown/DiscordChatExporter.Core.Markdown.csproj @@ -1,12 +1,11 @@  - net46;netstandard2.0 - latest + netstandard2.1 - + \ No newline at end of file diff --git a/DiscordChatExporter.Core.Models/DiscordChatExporter.Core.Models.csproj b/DiscordChatExporter.Core.Models/DiscordChatExporter.Core.Models.csproj index f5c9795..e7173b6 100644 --- a/DiscordChatExporter.Core.Models/DiscordChatExporter.Core.Models.csproj +++ b/DiscordChatExporter.Core.Models/DiscordChatExporter.Core.Models.csproj @@ -1,12 +1,11 @@  - net46;netstandard2.0 - latest + netstandard2.1 - + \ No newline at end of file diff --git a/DiscordChatExporter.Core.Rendering/DiscordChatExporter.Core.Rendering.csproj b/DiscordChatExporter.Core.Rendering/DiscordChatExporter.Core.Rendering.csproj index 4463952..40e16d8 100644 --- a/DiscordChatExporter.Core.Rendering/DiscordChatExporter.Core.Rendering.csproj +++ b/DiscordChatExporter.Core.Rendering/DiscordChatExporter.Core.Rendering.csproj @@ -1,8 +1,7 @@  - net46;netstandard2.0 - latest + netstandard2.1 diff --git a/DiscordChatExporter.Core.Services/DiscordChatExporter.Core.Services.csproj b/DiscordChatExporter.Core.Services/DiscordChatExporter.Core.Services.csproj index 4322c8e..c861ee5 100644 --- a/DiscordChatExporter.Core.Services/DiscordChatExporter.Core.Services.csproj +++ b/DiscordChatExporter.Core.Services/DiscordChatExporter.Core.Services.csproj @@ -1,15 +1,14 @@  - net46;netstandard2.0 - latest + netstandard2.1 - + diff --git a/DiscordChatExporter.Gui/DiscordChatExporter.Gui.csproj b/DiscordChatExporter.Gui/DiscordChatExporter.Gui.csproj index 76deb21..a7de1d3 100644 --- a/DiscordChatExporter.Gui/DiscordChatExporter.Gui.csproj +++ b/DiscordChatExporter.Gui/DiscordChatExporter.Gui.csproj @@ -1,158 +1,36 @@ - - - + + - Debug - AnyCPU - {732A67AF-93DE-49DF-B10F-FD74710B7863} WinExe - DiscordChatExporter.Gui + netcoreapp3.0 DiscordChatExporter - v4.6 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - true - latest - - - + 2.15 + Tyrrrz + Copyright (c) Alexey Golub + true + ../favicon.ico - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - ..\favicon.ico - - - - - - - - - 4.0 - - - - - - - - App.xaml - - - - - - - - - - - - - - - - - - - ExportSetupView.xaml - - - RootView.xaml - - - SettingsView.xaml - - - - - Code - - - True - True - Resources.resx - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - - + - - {67a9d184-4656-4ce1-9d75-bddcbcafb200} - DiscordChatExporter.Core.Models - - - {707c0cd0-a7e0-4cab-8db9-07a45cb87377} - DiscordChatExporter.Core.Services - + + - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - + + + + + + + + + - - 1.1.1 - - - 1.2.0 - - - 2.6.0 - - - 1.1.0 - - - 2.6.1 - - - 1.2.0 - - - 2.0.20525 - - - 1.6.2 - + + + + - + \ No newline at end of file diff --git a/DiscordChatExporter.Gui/Properties/AssemblyInfo.cs b/DiscordChatExporter.Gui/Properties/AssemblyInfo.cs deleted file mode 100644 index 1ddca7d..0000000 --- a/DiscordChatExporter.Gui/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,7 +0,0 @@ -using System.Reflection; - -[assembly: AssemblyTitle("DiscordChatExporter")] -[assembly: AssemblyCompany("Tyrrrz")] -[assembly: AssemblyCopyright("Copyright (c) Alexey Golub")] -[assembly: AssemblyVersion("2.15")] -[assembly: AssemblyFileVersion("2.15")] \ No newline at end of file diff --git a/DiscordChatExporter.Gui/Properties/Resources.Designer.cs b/DiscordChatExporter.Gui/Properties/Resources.Designer.cs deleted file mode 100644 index 3223eab..0000000 --- a/DiscordChatExporter.Gui/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace DiscordChatExporter.Gui.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DiscordChatExporter.Gui.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/DiscordChatExporter.Gui/Properties/Resources.resx b/DiscordChatExporter.Gui/Properties/Resources.resx deleted file mode 100644 index af7dbeb..0000000 --- a/DiscordChatExporter.Gui/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 5353591..aeddd37 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Build -FROM microsoft/dotnet:2.1-sdk AS build +FROM microsoft/dotnet:3.0-sdk AS build WORKDIR /src COPY favicon.ico ./ @@ -10,13 +10,13 @@ COPY DiscordChatExporter.Core.Rendering DiscordChatExporter.Core.Rendering COPY DiscordChatExporter.Core.Services DiscordChatExporter.Core.Services COPY DiscordChatExporter.Cli DiscordChatExporter.Cli -RUN dotnet publish DiscordChatExporter.Cli -c Release -f netcoreapp2.1 +RUN dotnet publish DiscordChatExporter.Cli -o DiscordChatExporter.Cli/publish -c Release # Run -FROM microsoft/dotnet:2.1-runtime AS run +FROM microsoft/dotnet:3.0-runtime AS run WORKDIR /app -COPY --from=build /src/DiscordChatExporter.Cli/bin/Release/netcoreapp2.1/publish ./ +COPY --from=build /src/DiscordChatExporter.Cli/publish ./ WORKDIR /app/out ENTRYPOINT ["dotnet", "/app/DiscordChatExporter.Cli.dll"] \ No newline at end of file diff --git a/UpdateVersion.ps1 b/UpdateVersion.ps1 index 7f75544..e1f6e28 100644 --- a/UpdateVersion.ps1 +++ b/UpdateVersion.ps1 @@ -9,4 +9,4 @@ function Replace-TextInFile { } Replace-TextInFile "$PSScriptRoot\DiscordChatExporter.Cli\DiscordChatExporter.Cli.csproj" '(?<=)(.*?)(?=)' $newVersion -Replace-TextInFile "$PSScriptRoot\DiscordChatExporter.Gui\Properties\AssemblyInfo.cs" '(?<=Assembly.*?Version\(")(.*?)(?="\)\])' $newVersion \ No newline at end of file +Replace-TextInFile "$PSScriptRoot\DiscordChatExporter.Gui\DiscordChatExporter.Gui.csproj" '(?<=)(.*?)(?=)' $newVersion \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index a9caedf..62f1f24 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,6 @@ version: '{build}' -image: Visual Studio 2019 Preview +image: Visual Studio 2019 configuration: Release before_build: @@ -10,12 +10,12 @@ build: verbosity: minimal after_build: -- ps: Deploy\Prepare.ps1 +- ps: Deploy/Prepare.ps1 artifacts: -- path: Deploy\Portable\bin\DiscordChatExporter.zip +- path: Deploy/bin/DiscordChatExporter.zip name: DiscordChatExporter.zip -- path: Deploy\Portable\bin\DiscordChatExporter.CLI.zip +- path: Deploy/bin/DiscordChatExporter.CLI.zip name: DiscordChatExporter.CLI.zip deploy: