From 74d5e2f0a016ea468121a59045c6d9a8590eb708 Mon Sep 17 00:00:00 2001 From: Th0mk Date: Tue, 26 Nov 2024 17:47:26 +0900 Subject: [PATCH] Update to .net 9 + packages --- .../.idea.FMBot.Discord/.idea/dataSources.xml | 2 +- src/Dockerfile | 4 +- src/FMBot.AppleMusic/FMBot.AppleMusic.csproj | 18 +++--- src/FMBot.Bot/FMBot.Bot.csproj | 58 +++++++++---------- src/FMBot.Discogs/FMBot.Discogs.csproj | 6 +- src/FMBot.Domain/FMBot.Domain.csproj | 4 +- src/FMBot.Images/FMBot.Images.csproj | 12 ++-- .../FMBot.LastFM.Domain.csproj | 6 +- src/FMBot.LastFM/FMBot.LastFM.csproj | 12 ++-- src/FMBot.Logger/FMBot.Logger.csproj | 18 ------ src/FMBot.Logger/Logger.cs | 43 -------------- .../FMBot.Persistence.Domain.csproj | 2 +- .../FMBot.Persistence.EntityFrameWork.csproj | 2 +- .../FMBot.Persistence.csproj | 6 +- .../FMBot.Subscriptions.csproj | 8 +-- src/FMBot.Tests/FMBot.Tests.csproj | 6 +- src/FMBot.Youtube/FMBot.Youtube.csproj | 12 ++-- src/Shared.Protos/Shared.Protos.csproj | 8 +-- 18 files changed, 83 insertions(+), 144 deletions(-) delete mode 100644 src/FMBot.Logger/FMBot.Logger.csproj delete mode 100644 src/FMBot.Logger/Logger.cs diff --git a/src/.idea/.idea.FMBot.Discord/.idea/dataSources.xml b/src/.idea/.idea.FMBot.Discord/.idea/dataSources.xml index b22078104..bce7b11d7 100644 --- a/src/.idea/.idea.FMBot.Discord/.idea/dataSources.xml +++ b/src/.idea/.idea.FMBot.Discord/.idea/dataSources.xml @@ -1,7 +1,7 @@ - + postgresql true org.postgresql.Driver diff --git a/src/Dockerfile b/src/Dockerfile index 6237ea3d3..f1e395a97 100644 --- a/src/Dockerfile +++ b/src/Dockerfile @@ -1,6 +1,6 @@ #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. -FROM mcr.microsoft.com/dotnet/runtime:8.0-noble-amd64 AS base +FROM mcr.microsoft.com/dotnet/runtime:9.0-noble-amd64 AS base RUN apt-get update -y && apt-get install -y libgdiplus software-properties-common RUN add-apt-repository ppa:ubuntuhandbook1/ffmpeg7 && apt update -y && apt install ffmpeg -y @@ -24,7 +24,7 @@ RUN wget --no-verbose -O /tmp/chrome.deb https://dl.google.com/linux/direct/goog ENV PUPPETEER_EXECUTABLE_PATH "/usr/bin/google-chrome-stable" -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build WORKDIR /src COPY ["src/FMBot.Bot", "FMBot.Bot/"] COPY ["src/FMBot.Images", "FMBot.Images/"] diff --git a/src/FMBot.AppleMusic/FMBot.AppleMusic.csproj b/src/FMBot.AppleMusic/FMBot.AppleMusic.csproj index fdb827e4b..bf7ada53c 100644 --- a/src/FMBot.AppleMusic/FMBot.AppleMusic.csproj +++ b/src/FMBot.AppleMusic/FMBot.AppleMusic.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable @@ -12,14 +12,14 @@ - - - - - - - - + + + + + + + + diff --git a/src/FMBot.Bot/FMBot.Bot.csproj b/src/FMBot.Bot/FMBot.Bot.csproj index befbdbd7d..bba683ff2 100644 --- a/src/FMBot.Bot/FMBot.Bot.csproj +++ b/src/FMBot.Bot/FMBot.Bot.csproj @@ -1,7 +1,7 @@ Exe - net8.0 + net9.0 false 9.0 Linux @@ -24,51 +24,51 @@ - - - - - + + + + + - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - - - - - - - - + + + + + + + + + - + - + - - - - - - + + + + + + diff --git a/src/FMBot.Discogs/FMBot.Discogs.csproj b/src/FMBot.Discogs/FMBot.Discogs.csproj index 6906aa2ba..baaddc49b 100644 --- a/src/FMBot.Discogs/FMBot.Discogs.csproj +++ b/src/FMBot.Discogs/FMBot.Discogs.csproj @@ -2,7 +2,7 @@ Library - net8.0 + net9.0 enable @@ -11,8 +11,8 @@ - - + + diff --git a/src/FMBot.Domain/FMBot.Domain.csproj b/src/FMBot.Domain/FMBot.Domain.csproj index f80da6cb7..eda70dd52 100644 --- a/src/FMBot.Domain/FMBot.Domain.csproj +++ b/src/FMBot.Domain/FMBot.Domain.csproj @@ -1,14 +1,14 @@ - net8.0 + net9.0 - + diff --git a/src/FMBot.Images/FMBot.Images.csproj b/src/FMBot.Images/FMBot.Images.csproj index 8f5f24213..7bb03fe37 100644 --- a/src/FMBot.Images/FMBot.Images.csproj +++ b/src/FMBot.Images/FMBot.Images.csproj @@ -2,7 +2,7 @@ Library - net8.0 + net9.0 enable disable @@ -15,11 +15,11 @@ - - - - - + + + + + diff --git a/src/FMBot.LastFM.Domain/FMBot.LastFM.Domain.csproj b/src/FMBot.LastFM.Domain/FMBot.LastFM.Domain.csproj index 05c8471c8..b660481d0 100644 --- a/src/FMBot.LastFM.Domain/FMBot.LastFM.Domain.csproj +++ b/src/FMBot.LastFM.Domain/FMBot.LastFM.Domain.csproj @@ -1,7 +1,7 @@ - + - net8.0 + net9.0 @@ -11,7 +11,7 @@ - + diff --git a/src/FMBot.LastFM/FMBot.LastFM.csproj b/src/FMBot.LastFM/FMBot.LastFM.csproj index 91c81db67..57aa4065e 100644 --- a/src/FMBot.LastFM/FMBot.LastFM.csproj +++ b/src/FMBot.LastFM/FMBot.LastFM.csproj @@ -2,7 +2,7 @@ Library - net8.0 + net9.0 false @@ -20,14 +20,14 @@ - - - + + + - + - + diff --git a/src/FMBot.Logger/FMBot.Logger.csproj b/src/FMBot.Logger/FMBot.Logger.csproj deleted file mode 100644 index 04c03f3d7..000000000 --- a/src/FMBot.Logger/FMBot.Logger.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net7.0 - 9.0 - FMBot.Logger - FMBot.Logger - - - - latest - - - - latest - - - diff --git a/src/FMBot.Logger/Logger.cs b/src/FMBot.Logger/Logger.cs deleted file mode 100644 index 20391f6d7..000000000 --- a/src/FMBot.Logger/Logger.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.IO; - -namespace FMBot.Logger; - -public class Logger -{ - public void Log(string text, ConsoleColor color = ConsoleColor.Gray) - { - Console.ForegroundColor = color; - Console.WriteLine($"{DateTime.Now:hh:mm:ss.fff} : " + text); - Console.ResetColor(); - - var filePath = $"Logs/{DateTime.Now:MMMM, yyyy}"; - if (!File.Exists(filePath)) Directory.CreateDirectory(filePath); - filePath += $"/{DateTime.Now:dddd, MMMM d, yyyy}.txt"; - using var file = new FileStream(filePath, FileMode.Append, FileAccess.Write, FileShare.ReadWrite); - using var sw = new StreamWriter(file); - - sw.WriteLine($"{DateTime.Now:T} : {text}"); - } - - public void LogError(string errorReason, string message = null, string username = null, string guildName = null, ulong? guildId = null) - { - string error = $"{DateTime.Now:T} : Error - {errorReason} \n" + - $"{DateTime.Now:T} : {message} \n" + - $"{DateTime.Now:T} : User: {username} \n" + - $"{DateTime.Now:T} : Guild: {guildName} | Id: {guildId} \n" + - "===================================="; - - Log(error); - } - - public void LogException(string errorReason, Exception exception) - { - string error = $"{DateTime.Now:T} : Exception - {errorReason} \n" + - $"{DateTime.Now:T} : {exception.Message} \n" + - $"{DateTime.Now:T} : {exception.InnerException} \n" + - "===================================="; - - Log(error); - } -} diff --git a/src/FMBot.Persistence.Domain/FMBot.Persistence.Domain.csproj b/src/FMBot.Persistence.Domain/FMBot.Persistence.Domain.csproj index e21b7638e..34934c8a1 100644 --- a/src/FMBot.Persistence.Domain/FMBot.Persistence.Domain.csproj +++ b/src/FMBot.Persistence.Domain/FMBot.Persistence.Domain.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 diff --git a/src/FMBot.Persistence.EntityFrameWork/FMBot.Persistence.EntityFrameWork.csproj b/src/FMBot.Persistence.EntityFrameWork/FMBot.Persistence.EntityFrameWork.csproj index 54ed612d1..fccbec65b 100644 --- a/src/FMBot.Persistence.EntityFrameWork/FMBot.Persistence.EntityFrameWork.csproj +++ b/src/FMBot.Persistence.EntityFrameWork/FMBot.Persistence.EntityFrameWork.csproj @@ -1,7 +1,7 @@ Library - net8.0 + net9.0 false diff --git a/src/FMBot.Persistence/FMBot.Persistence.csproj b/src/FMBot.Persistence/FMBot.Persistence.csproj index 9b46c9199..891548e08 100644 --- a/src/FMBot.Persistence/FMBot.Persistence.csproj +++ b/src/FMBot.Persistence/FMBot.Persistence.csproj @@ -1,14 +1,14 @@ - + - net8.0 + net9.0 - + diff --git a/src/FMBot.Subscriptions/FMBot.Subscriptions.csproj b/src/FMBot.Subscriptions/FMBot.Subscriptions.csproj index dea2056ad..922cd0912 100644 --- a/src/FMBot.Subscriptions/FMBot.Subscriptions.csproj +++ b/src/FMBot.Subscriptions/FMBot.Subscriptions.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable disable @@ -13,9 +13,9 @@ - - - + + + diff --git a/src/FMBot.Tests/FMBot.Tests.csproj b/src/FMBot.Tests/FMBot.Tests.csproj index 8cb999cd1..ae60542bb 100644 --- a/src/FMBot.Tests/FMBot.Tests.csproj +++ b/src/FMBot.Tests/FMBot.Tests.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable enable @@ -9,11 +9,11 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/FMBot.Youtube/FMBot.Youtube.csproj b/src/FMBot.Youtube/FMBot.Youtube.csproj index 7c189b264..054c35386 100644 --- a/src/FMBot.Youtube/FMBot.Youtube.csproj +++ b/src/FMBot.Youtube/FMBot.Youtube.csproj @@ -1,8 +1,8 @@ - + Library - net8.0 + net9.0 false @@ -10,10 +10,10 @@ - - - - + + + + diff --git a/src/Shared.Protos/Shared.Protos.csproj b/src/Shared.Protos/Shared.Protos.csproj index f343bc5db..c13f1be4e 100644 --- a/src/Shared.Protos/Shared.Protos.csproj +++ b/src/Shared.Protos/Shared.Protos.csproj @@ -1,14 +1,14 @@ - + - net8.0 + net9.0 enable enable - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive