diff --git a/Credits/Credits.txt b/Credits/Credits.txt index d7a7cad05..be97f3370 100644 --- a/Credits/Credits.txt +++ b/Credits/Credits.txt @@ -26,14 +26,6 @@ Description:LiteDB - A .NET NoSQL Document Store in a single data file licenseUrl:https://github.com/mbdavid/LiteDB/blob/master/LICENSE license Type:MIT -######################### -Package:AutoMapper -Version:13.0.1 -project URL:https://automapper.org/ -Description:A convention-based object-object mapper. -licenseUrl:https://licenses.nuget.org/MIT -license Type:MIT - ######################### Package:Avalonia Version:0.10.21 @@ -82,9 +74,17 @@ Description:Avalonia front-end for the HtmlRenderer project. licenseUrl:https://licenses.nuget.org/MIT license Type:MIT +######################### +Package:AwesomeAssertions +Version:9.3.0 +project URL:https://github.com/AwesomeAssertions/AwesomeAssertions +Description:A fork of FluentAssertions. +licenseUrl:https://licenses.nuget.org/Apache-2.0 +license Type:Apache-2.0 + ######################### Package:BCnEncoder.Net -Version:2.1.0 +Version:2.2.1 project URL:https://github.com/Nominom/BCnEncoder.NET Description:BCnEncoder.NET is a library for compressing rgba images to different block-compressed formats. Both ktx and dds output file-formats are supported. It has no native dependencies and is .NET Standard 2.1 compatible. @@ -102,7 +102,7 @@ license Type:MIT OR Unlicense ######################### Package:Castle.Core -Version:5.1.1 +Version:5.2.1 project URL:http://www.castleproject.org/ Description:Castle Core, including DynamicProxy, Logging Abstractions and DictionaryAdapter licenseUrl:https://licenses.nuget.org/Apache-2.0 @@ -110,7 +110,7 @@ license Type:Apache-2.0 ######################### Package:CodexMicroORM.Core -Version:1.1.0 +Version:1.3.2 project URL:https://github.com/codexguy/CodexMicroORM Description:A high performance, low code alternative to ORM's such as Entity Framework, offers intelligent database mapping to your existing CLR objects with minimal effort. Visit "Design Goals" on GitHub to see more rationale and guidance. licenseUrl:https://licenses.nuget.org/Apache-2.0 @@ -126,10 +126,10 @@ license Type:MIT ######################### Package:CompareNETObjects -Version:4.83.0 +Version:4.84.0 project URL:https://github.com/GregFinzer/Compare-Net-Objects Description:What you have been waiting for. Perform a deep compare of any two .NET objects using reflection. Shows the differences between the two objects. -licenseUrl:https://www.nuget.org/packages/CompareNETObjects/4.83.0/License +licenseUrl:https://www.nuget.org/packages/CompareNETObjects/4.84.0/License license Type:Microsoft Public License (Ms-PL) ######################### @@ -142,37 +142,17 @@ license Type:MIT ######################### Package:DiffPlex -Version:1.7.2 +Version:1.9.0 project URL:https://github.com/mmanela/diffplex/ -Description:DiffPlex is a diffing library that allows you to programatically create text diffs. DiffPlex is a fast and tested library. -licenseUrl:https://licenses.nuget.org/Apache-2.0 -license Type:Apache-2.0 - -######################### -Package:ProDotNetZip -Version:1.18.0 -project URL:https://github.com/mihula/ProDotNetZip -Description:A fork of the DotNetZip project without signing with a solution that compiles cleanly. This project aims to use only up-to-date references. DotNetZip is a FAST, FREE class library and toolset for manipulating zip files. Use VB, C# or any .NET language to easily create, extract, or update zip files. -licenseUrl:https://www.nuget.org/packages/ProDotNetZip/1.18.0/License -license Type:BSD, Apache, zlib and MIT - -######################### -Package:FluentAssertions -Version:6.12.0 -project URL:https://www.fluentassertions.com/ -Description:A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or - BDD-style unit tests. Targets .NET Framework 4.7, .NET Core 2.1 and 3.0, .NET 6, as well as .NET Standard 2.0 and 2.1. - Supports the unit test frameworks MSTest2, NUnit3, XUnit2, MSpec, and NSpec3. - - Supported by InfoSupport B.V. +Description:DiffPlex is a diffing library that allows you to programmatically create text diffs. DiffPlex is a fast and tested library. licenseUrl:https://licenses.nuget.org/Apache-2.0 license Type:Apache-2.0 ######################### Package:FSharp.Core -Version:8.0.200 +Version:10.0.100 project URL:https://github.com/dotnet/fsharp -Description:FSharp.Core redistributables from F# Tools version 12.8.200 For F# 8.0. Contains code from the F# Software Foundation. +Description:FSharp.Core redistributables from F# Tools version 14.0.100 For F# 10.0. Contains code from the F# Software Foundation. licenseUrl:https://licenses.nuget.org/MIT license Type:MIT @@ -210,7 +190,7 @@ license Type:Apache-2.0 ######################### Package:Magick.NET-Q8-x64 -Version:13.6.0 +Version:14.9.1 project URL:https://github.com/dlemstra/Magick.NET Description:ImageMagick is a powerful image manipulation library that supports over 100 major file formats (not including sub-formats). With Magick.NET you can use ImageMagick without having to install ImageMagick on your server or desktop. Visit https://github.com/dlemstra/Magick.NET/tree/main/docs before installing to help you decide the best version. licenseUrl:https://licenses.nuget.org/Apache-2.0 @@ -261,13 +241,21 @@ System.Collections.Generic.IAsyncEnumerator licenseUrl:https://licenses.nuget.org/MIT license Type:MIT +######################### +Package:MagicMapper +Version:14.0.0 +project URL:https://automapper.org/ +Description:A convention-based object-object mapper. +licenseUrl:https://licenses.nuget.org/MIT +license Type:MIT + ######################### Package:Microsoft.NET.Test.Sdk -Version:17.9.0 +Version:18.0.1 project URL:https://github.com/microsoft/vstest Description:The MSbuild targets and properties for building .NET test projects. -licenseUrl:https://www.nuget.org/packages/Microsoft.NET.Test.Sdk/17.3.0/License -license Type:MICROSOFT SOFTWARE LICENSE TERMS +licenseUrl:https://licenses.nuget.org/MIT +license Type:MIT ######################### Package:Microsoft.VisualStudio.SlowCheetah @@ -296,7 +284,7 @@ license Type:MIT ######################### Package:MimeTypes -Version:2.4.1 +Version:2.5.2 project URL:https://github.com/khellang/MimeTypes Description:A simple lookup from file name/extension to MIME/media type and vice versa, generated from mime-db, which in turn is compiled from IANA, Apache and nginx's MIME types. licenseUrl:https://licenses.nuget.org/Apache-2.0 @@ -304,7 +292,7 @@ license Type:Apache-2.0 ######################### Package:Moq -Version:4.20.70 +Version:4.20.72 project URL:https://github.com/moq/moq Description:Moq is the most popular and friendly mocking framework for .NET. licenseUrl:https://licenses.nuget.org/BSD-3-Clause @@ -312,7 +300,7 @@ license Type:BSD-3-Clause ######################### Package:NaturalSort.Extension -Version:4.2.0+build.231 +Version:4.4.1 project URL:https://github.com/tompazourek/NaturalSort.Extension Description:Extension method for StringComparison that adds support for natural sorting (e.g. "abc1", "abc2", "abc10" instead of "abc1", "abc10", "abc2"). licenseUrl:https://licenses.nuget.org/MIT @@ -320,7 +308,7 @@ license Type:MIT ######################### Package:Nerdbank.GitVersioning -Version:3.6.133 +Version:3.9.50 project URL:https://github.com/dotnet/Nerdbank.GitVersioning Description:Stamps your assemblies with semver 2.0 compliant git commit specific version information and provides NuGet versioning information as well. licenseUrl:https://licenses.nuget.org/MIT @@ -336,7 +324,7 @@ license Type:MIT ######################### Package:Newtonsoft.Json -Version:13.0.3 +Version:13.0.4 project URL:https://www.newtonsoft.com/json Description:Json.NET is a popular high-performance JSON framework for .NET licenseUrl:https://licenses.nuget.org/MIT @@ -352,35 +340,36 @@ license Type:MIT ######################### Package:NLog -Version:5.2.8 +Version:6.0.6 project URL:https://nlog-project.org/ Description:NLog is a logging platform for .NET with rich log routing and management capabilities. NLog supports traditional logging, structured logging and the combination of both. Supported platforms: -- .NET 5, 6, 7 and 8 -- .NET Core 1, 2 and 3 -- .NET Standard 1.3+ and 2.0+ +- .NET 6, 7, 8, 9 and 10 +- .NET Standard 2.0 and 2.1 - .NET Framework 3.5 - 4.8 - Xamarin Android + iOS (.NET Standard) - Mono 4 -For ASP.NET Core, check: https://www.nuget.org/packages/NLog.Web.AspNetCore +For integrating NLog with Microsoft.Extensions.Logging, check: https://www.nuget.org/packages/NLog.Extensions.Logging + +For using NLog with ASP.NET Core, check: https://www.nuget.org/packages/NLog.Web.AspNetCore licenseUrl:https://licenses.nuget.org/BSD-3-Clause license Type:BSD-3-Clause ######################### Package:Pfim -Version:0.11.2 +Version:0.11.4 project URL:https://nickbabcock.github.io/Pfim/ Description:A simple and fast .NET Standard image decoder for targa (.tga) and direct draw surface (.dds) images licenseUrl:https://raw.githubusercontent.com/nickbabcock/Pfim/master/LICENSE.txt -license Type:MIT +license Type: ######################### Package:PommaLabs.MimeTypes -Version:2.9.1+63b5125a +Version:3.1.0+97cf707b project URL:https://gitlab.com/pommalabs/mime-types Description:MIME content type definitions mapped with file extensions and file signatures. licenseUrl:https://licenses.nuget.org/MIT @@ -392,11 +381,19 @@ Version:1.9.0 project URL:https://www.bouncycastle.org/csharp/ Description:BouncyCastle portable version with support for .NET 4, .NET Standard 2.0 licenseUrl:https://www.bouncycastle.org/csharp/licence.html -license Type:Adapted MIT License +license Type: + +######################### +Package:ProDotNetZip +Version:1.20.0 +project URL:https://github.com/mihula/ProDotNetZip +Description:ProDotNetZip is rip off the original DotNetZip code with limitation to NET standard subset and with fixed vulnerabilities. +licenseUrl:https://www.nuget.org/packages/ProDotNetZip/1.20.0/License +license Type:LICENSE.txt ######################### Package:ReactiveUI -Version:19.5.41 +Version:22.3.1 project URL:https://reactiveui.net/ Description:A MVVM framework that integrates with the Reactive Extensions for .NET to create elegant, testable User Interfaces that run on any mobile or desktop platform. This is the base package with the base platform implementations licenseUrl:https://licenses.nuget.org/MIT @@ -418,25 +415,17 @@ Description:A hybrid .NET ORM library for SQLite (using Microsoft.Data.Sqlite). licenseUrl:https://www.nuget.org/packages/RepoDb.Sqlite.Microsoft/1.13.1/License license Type:Apache License 2.0 -######################### -Package:Sajidur78.StrongNamer -Version:0.2.8 -project URL:https://github.com/sajidur78/strongnamer -Description:Strong Namer will automatically add strong names to referenced assemblies which do not already have a strong name. -licenseUrl:https://github.com/Sajidur78/strongnamer/blob/master/LICENSE -license Type:MIT - ######################### Package:SharpCompress -Version:0.36.0 +Version:0.42.0 project URL:https://github.com/adamhathcock/sharpcompress -Description:SharpCompress is a compression library for NET Standard 2.0/2.1/NET 6.0/NET 7.0 that can unrar, decompress 7zip, decompress xz, zip/unzip, tar/untar lzip/unlzip, bzip2/unbzip2 and gzip/ungzip with forward-only reading and file random access APIs. Write support for zip/tar/bzip2/gzip is implemented. +Description:SharpCompress is a compression library for NET Standard 2.0/NET 4.8/NET 4.8.1/NET 6.0/NET 8.0 that can unrar, decompress 7zip, decompress xz, zip/unzip, tar/untar lzip/unlzip, bzip2/unbzip2 and gzip/ungzip with forward-only reading and file random access APIs. Write support for zip/tar/bzip2/gzip is implemented. licenseUrl:https://licenses.nuget.org/MIT license Type:MIT ######################### Package:SimpleInjector -Version:5.4.4 +Version:5.5.0 project URL:https://simpleinjector.org/ Description:Simple Injector is an easy, flexible and fast dependency injection library that uses best practice to guide your solutions toward the pit of success. licenseUrl:https://licenses.nuget.org/MIT @@ -444,8 +433,9 @@ license Type:MIT ######################### Package:SimpleInjector.Packaging -Version:5.0.0 +Version:5.5.0 project URL:https://simpleinjector.org/ +######################### Description:Adds support for packaging sets of related services to allow registering them together. Consumers can implement the IPackage interface and use the RegisterPackages extension method to dynamically add registrations in the supplied list of assemblies. licenseUrl:https://licenses.nuget.org/MIT license Type:MIT @@ -485,7 +475,7 @@ license Type:Apache-2.0 ######################### Package:SmartFormat -Version:3.3.2 +Version:3.6.1 project URL:https://github.com/axuno/SmartFormat Description:This package contains the core SmartFormat assemblies with core extensions built-in. @@ -497,7 +487,7 @@ license Type:MIT ######################### Package:Splat.NLog -Version:14.8.12 +Version:17.1.1 project URL:https://github.com/reactiveui/splat/ Description:A library to make things cross-platform that should be. licenseUrl:https://licenses.nuget.org/MIT @@ -505,7 +495,7 @@ license Type:MIT ######################### Package:Splat.SimpleInjector -Version:14.8.12 +Version:17.1.1 project URL:https://github.com/reactiveui/splat/ Description:A library to make things cross-platform that should be. licenseUrl:https://licenses.nuget.org/MIT @@ -537,7 +527,7 @@ license Type: ######################### Package:System.Linq.Async -Version:6.0.1 +Version:7.0.0 project URL:https://github.com/dotnet/reactive Description:Provides support for Language-Integrated Query (LINQ) over IAsyncEnumerable sequences. licenseUrl:https://licenses.nuget.org/MIT @@ -545,7 +535,7 @@ license Type:MIT ######################### Package:System.Reactive -Version:6.0.0 +Version:6.1.0 project URL:https://github.com/dotnet/reactive Description:Reactive Extensions (Rx) for .NET licenseUrl:https://licenses.nuget.org/MIT @@ -561,7 +551,7 @@ license Type:MIT ######################### Package:UTF.Unknown -Version:2.5.1 +Version:2.6.0 project URL:https://github.com/CharsetDetector/UTF-unknown Description:Detect character set for files, streams and other bytes. @@ -570,15 +560,14 @@ Description:Detect character set for files, streams and other bytes. Features: - Easy to use API - Supports frameworks: - - .NET Standard 1.0 - - .NET Standard 1.3 and 2.0 - - .NET Core 3.0 (because `System.Text.Encoding.CodePages` in shared framework) - - .NET Framework 4.0 + - .NET 6 (Will be dropped in the future) + - .NET 8 + - .NET Standard 2.0 - Strong named - XML documentation included Compared to Ude: - + - Refactor of API, namespaces and deadcode removal - Added some docs - Improve error handling @@ -606,7 +595,7 @@ license Type:Apache-2.0 ######################### Package:xunit.runner.visualstudio -Version:2.4.5 +Version:3.1.5 project URL:https://github.com/xunit/visualstudio.xunit Description:Visual Studio 2019 16.8+ Test Explorer runner for the xUnit.net framework. Capable of running xUnit.net v1.9.2 and v2.0+ tests. Supports .NET 4.7.2 or later, .NET Core 3.1 or later, and Universal Windows 10.0.16299 or later. licenseUrl:https://licenses.nuget.org/MIT diff --git a/Directory.Build.props b/Directory.Build.props index 93fe4a47b..8fccbb037 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,51 +1,64 @@ - - Mario - Mario - Irony Mod Manager - Mario - LICENSE - https://github.com/bcssov/IronyModManager - https://github.com/bcssov/IronyModManager - GIT - false - false - - - $(MSBuildThisFileDirectory) - - - $(MSBuildProjectDirectory)=$(MSBuildProjectName) - - - [8.0.0] - [8.0.0-preview.7.23375.6] - [8.0.1] - [8.0.0] - [2.1.17] - - - [2.5.1] - [2.1.0] - [0.10.22] - [0.10.12.2] - [1.1.10] - [0.10.17] - - [2.4.5] - - [1.0.4] - [1.0.0-beta13.15] - [0.0.0-alpha.0.132] - - - - 3.6.133 - all - - - - - - + + Mario + Mario + Irony Mod Manager + Mario + LICENSE + https://github.com/bcssov/IronyModManager + https://github.com/bcssov/IronyModManager + GIT + false + false + + + $(MSBuildThisFileDirectory) + + + $(MSBuildProjectDirectory)=$(MSBuildProjectName) + + + [8.0.2] + [8.0.0-preview.7.23375.6] + [8.0.2] + [8.0.1] + [8.0.0] + [8.0.0] + [8.0.0] + [2.1.17] + + + [2.5.1] + [2.1.0] + [0.10.22] + [0.10.12.2] + [1.1.10] + [0.10.17] + + [3.1.5] + + [1.0.4] + [1.0.0-beta13.15] + [0.0.0-alpha.0.132] + + [2.3.0] + + [2.2.3] + + [2.88.9] + + [17.1.1] + + + + 3.9.50 + all + + + + + + \ No newline at end of file diff --git a/GlobalSuppressions.cs b/GlobalSuppressions.cs index a42d581b2..49f4dc3ca 100644 --- a/GlobalSuppressions.cs +++ b/GlobalSuppressions.cs @@ -3,7 +3,11 @@ // Project-level suppressions either have no target or are given // a specific target and scoped to a namespace, type, member, etc. +using System; +using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; +using System.Linq; [assembly: SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Disabled", Scope = "module")] [assembly: SuppressMessage("GeneratedRegex", "SYSLIB1045:Convert to 'GeneratedRegexAttribute'.", Justification = "", Scope = "module")] +[assembly: SuppressMessage("Performance", "CA1859:Use concrete types when possible for improved performance", Justification = "Disabled", Scope = "module")] diff --git a/References/Conditional/Steamworks/.Net/OSX-Linux/Steamworks.NET.dll b/References/Conditional/Steamworks/.Net/OSX-Linux/Steamworks.NET.dll new file mode 100644 index 000000000..387f48123 Binary files /dev/null and b/References/Conditional/Steamworks/.Net/OSX-Linux/Steamworks.NET.dll differ diff --git a/References/Conditional/Steamworks/.Net/Windows/Steamworks.NET.dll b/References/Conditional/Steamworks/.Net/Windows/Steamworks.NET.dll new file mode 100644 index 000000000..8e6f1cfab Binary files /dev/null and b/References/Conditional/Steamworks/.Net/Windows/Steamworks.NET.dll differ diff --git a/References/Conditional/Steamworks/OSX-Linux-x64/libsteam_api.so b/References/Conditional/Steamworks/OSX-Linux-x64/libsteam_api.so index 8bf6762bb..8783570d2 100644 Binary files a/References/Conditional/Steamworks/OSX-Linux-x64/libsteam_api.so and b/References/Conditional/Steamworks/OSX-Linux-x64/libsteam_api.so differ diff --git a/References/Conditional/Steamworks/OSX-Linux-x64/steam_api.bundle/Contents/Info.plist b/References/Conditional/Steamworks/OSX-Linux-x64/steam_api.bundle/Contents/Info.plist index 9045a402d..854dc2087 100644 --- a/References/Conditional/Steamworks/OSX-Linux-x64/steam_api.bundle/Contents/Info.plist +++ b/References/Conditional/Steamworks/OSX-Linux-x64/steam_api.bundle/Contents/Info.plist @@ -17,7 +17,7 @@ CFBundleSignature ???? CFBundleVersion - 1.53 + 1.62 CSResourcesFileMapped yes DTCompiler diff --git a/References/Conditional/Steamworks/OSX-Linux-x64/steam_api.bundle/Contents/MacOS/libsteam_api.dylib b/References/Conditional/Steamworks/OSX-Linux-x64/steam_api.bundle/Contents/MacOS/libsteam_api.dylib index 8d3c5eeb8..c493b2b52 100644 Binary files a/References/Conditional/Steamworks/OSX-Linux-x64/steam_api.bundle/Contents/MacOS/libsteam_api.dylib and b/References/Conditional/Steamworks/OSX-Linux-x64/steam_api.bundle/Contents/MacOS/libsteam_api.dylib differ diff --git a/References/Conditional/Steamworks/Windows-x64/steam_api64.dll b/References/Conditional/Steamworks/Windows-x64/steam_api64.dll index e1ca6923a..6d118254f 100644 Binary files a/References/Conditional/Steamworks/Windows-x64/steam_api64.dll and b/References/Conditional/Steamworks/Windows-x64/steam_api64.dll differ diff --git a/References/CopyAll/Maps/HeartsofIronIVParserMap.json b/References/CopyAll/Maps/HeartsofIronIVParserMap.json index 4da7c4b27..1ce58a29a 100644 --- a/References/CopyAll/Maps/HeartsofIronIVParserMap.json +++ b/References/CopyAll/Maps/HeartsofIronIVParserMap.json @@ -25,7 +25,7 @@ }, { "DirectoryPath": "common\\ai_peace", "PreferredParser": "DefaultParser" - }, + }, { "DirectoryPath": "common\\ai_navy\\fleet", "PreferredParser": "DefaultParser" }, { diff --git a/References/Direct/LiteDB.dll b/References/Direct/LiteDB.dll index 6ee13bbfa..7310f077f 100644 Binary files a/References/Direct/LiteDB.dll and b/References/Direct/LiteDB.dll differ diff --git a/References/Direct/ProDotNetZip.dll b/References/Direct/ProDotNetZip.dll deleted file mode 100644 index 7eb505b11..000000000 Binary files a/References/Direct/ProDotNetZip.dll and /dev/null differ diff --git a/References/Direct/Readme.txt b/References/Direct/Readme.txt index 74b2c3533..7ebbb8e86 100644 --- a/References/Direct/Readme.txt +++ b/References/Direct/Readme.txt @@ -7,8 +7,4 @@ Had to build to remove hardcoded document size limit 3. NWayland & Avalonia.Wayland Source: https://github.com/bcssov/NWayland Check Irony branch. The functionality is still a PR and not compatible with 0.10 (only 0.11 preview). Therefore the logic was ripped from there. -Depends on nuget: Wanhjor.ObjectInspector -4. ProDotNet -Source: https://github.com/bcssov/ProDotNet -Built manually due to https://github.com/advisories/GHSA-xhg6-9j5j-w4vf vulnerabiity to apply a patch -Depends on nugets: System.Security.Permissions and System.Text.Encoding.CodePages \ No newline at end of file +Depends on nuget: Wanhjor.ObjectInspector \ No newline at end of file diff --git a/publish/publish-linux-x64.bat b/publish/publish-linux-x64.bat index 3781e206b..dd1e92f11 100644 --- a/publish/publish-linux-x64.bat +++ b/publish/publish-linux-x64.bat @@ -29,4 +29,5 @@ del "src\IronyModManager\bin\x64\linux-x64\net8.0\publish\linux-x64\steam_api64. xcopy "References\CopyAll\*.*" "src\IronyModManager\bin\x64\linux-x64\net8.0\publish\linux-x64\" /Y /S /D REM Why on earth cannot nuget include these? Also the documentation sucks in this regard xcopy "References\Conditional\Steamworks\OSX-Linux-x64\libsteam_api.so" "src\IronyModManager\bin\x64\linux-x64\net8.0\publish\linux-x64\" /Y /S /D +xcopy "References\Conditional\Steamworks\.Net\OSX-Linux\*.*" "src\IronyModManager\bin\x64\win-x64\net8.0\publish\win-x64\" /Y /S /D cd publish \ No newline at end of file diff --git a/publish/publish-osx-x64.bat b/publish/publish-osx-x64.bat index cb1dd7d64..2e9ef4fd8 100644 --- a/publish/publish-osx-x64.bat +++ b/publish/publish-osx-x64.bat @@ -29,4 +29,5 @@ del "src\IronyModManager\bin\x64\osx-x64\net8.0\publish\osx-x64\steam_api64.dll" xcopy "References\CopyAll\*.*" "src\IronyModManager\bin\x64\osx-x64\net8.0\publish\osx-x64\" /Y /S /D REM Why on earth cannot nuget include these? Also the documentation sucks in this regard xcopy "References\Conditional\Steamworks\OSX-Linux-x64\steam_api.bundle\Contents\MacOS\*.*" "src\IronyModManager\bin\x64\osx-x64\net8.0\publish\osx-x64\" /Y /S /D +xcopy "References\Conditional\Steamworks\.Net\OSX-Linux\*.*" "src\IronyModManager\bin\x64\win-x64\net8.0\publish\win-x64\" /Y /S /D cd publish \ No newline at end of file diff --git a/publish/publish-win-x64.bat b/publish/publish-win-x64.bat index 66a6321f9..6b2640355 100644 --- a/publish/publish-win-x64.bat +++ b/publish/publish-win-x64.bat @@ -30,4 +30,5 @@ del "src\IronyModManager\bin\x64\win-x64\net8.0\publish\win-x64\IronyModManager. del "src\IronyModManager\bin\x64\win-x64\net8.0\publish\win-x64\steam_api64.dll" /S /Q xcopy "References\CopyAll\*.*" "src\IronyModManager\bin\x64\win-x64\net8.0\publish\win-x64\" /Y /S /D xcopy "References\Conditional\Steamworks\Windows-x64\*.*" "src\IronyModManager\bin\x64\win-x64\net8.0\publish\win-x64\" /Y /S /D +xcopy "References\Conditional\Steamworks\.Net\Windows\*.*" "src\IronyModManager\bin\x64\win-x64\net8.0\publish\win-x64\" /Y /S /D cd publish \ No newline at end of file diff --git a/src/Irony.AppCastGenerator/Irony.AppCastGenerator.csproj b/src/Irony.AppCastGenerator/Irony.AppCastGenerator.csproj index 3dd742930..763d411b3 100644 --- a/src/Irony.AppCastGenerator/Irony.AppCastGenerator.csproj +++ b/src/Irony.AppCastGenerator/Irony.AppCastGenerator.csproj @@ -14,7 +14,7 @@ true x64 x64 - 1701;1702;NU1603 + 1701;1702;NU1603;CS8002 false @@ -24,13 +24,12 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - diff --git a/src/Irony.AppCastGenerator/Program.cs b/src/Irony.AppCastGenerator/Program.cs index afd27c6d2..c682ca866 100644 --- a/src/Irony.AppCastGenerator/Program.cs +++ b/src/Irony.AppCastGenerator/Program.cs @@ -4,13 +4,14 @@ // Created : 09-14-2020 // // Last Modified By : Mario -// Last Modified On : 01-28-2022 +// Last Modified On : 12-07-2025 // *********************************************************************** // // NetSparkle // // // *********************************************************************** + using System; using System.Collections.Generic; using System.Diagnostics; @@ -35,7 +36,7 @@ internal class Program /// /// The signature manager /// - private static readonly SignatureManager _signatureManager = new(); + private static readonly SignatureManager signatureManager = new(); #endregion Fields @@ -59,7 +60,7 @@ public static void Main(string[] args) /// System.String. private static string GetTitleVersionFromAssembly(FileInfo fileInfo) { - return FileVersionInfo.GetVersionInfo(fileInfo.FullName).ProductVersion.Split("+", StringSplitOptions.RemoveEmptyEntries)[0]; + return FileVersionInfo.GetVersionInfo(fileInfo.FullName).ProductVersion!.Split("+", StringSplitOptions.RemoveEmptyEntries)[0]; } /// @@ -87,41 +88,44 @@ private static void HandleParseError(IEnumerable errs) /// The opts. private static void Run(Options opts) { - // Really really lacks documentation - _signatureManager.SetStorageDirectory(opts.KeyLocation); + // Really, really lacks documentation + signatureManager.SetStorageDirectory(opts.KeyLocation); Environment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory; if (opts.Export) { Console.WriteLine("Private Key:"); - Console.WriteLine(Convert.ToBase64String(_signatureManager.GetPrivateKey())); + Console.WriteLine(Convert.ToBase64String(signatureManager.GetPrivateKey())); Console.WriteLine("Public Key:"); - Console.WriteLine(Convert.ToBase64String(_signatureManager.GetPublicKey())); + Console.WriteLine(Convert.ToBase64String(signatureManager.GetPublicKey())); return; } if (opts.GenerateKeys) { - var didSucceed = _signatureManager.Generate(opts.ForceRegeneration); + var didSucceed = signatureManager.Generate(opts.ForceRegeneration); if (didSucceed) { #pragma warning disable CA2241 // Provide correct arguments to formatting methods + // ReSharper disable once FormatStringProblem Console.WriteLine("Keys successfully generated", Color.Green); #pragma warning restore CA2241 // Provide correct arguments to formatting methods } else { #pragma warning disable CA2241 // Provide correct arguments to formatting methods + // ReSharper disable once FormatStringProblem Console.WriteLine("Keys failed to generate", Color.Red); #pragma warning restore CA2241 // Provide correct arguments to formatting methods } + return; } if (opts.BinaryToSign != null) { - var signature = _signatureManager.GetSignatureForFile(new FileInfo(opts.BinaryToSign)); + var signature = signatureManager.GetSignatureForFile(new FileInfo(opts.BinaryToSign)); Console.WriteLine($"Signature: {signature}", Color.Green); @@ -130,22 +134,24 @@ private static void Run(Options opts) if (opts.BinaryToVerify != null) { - var result = _signatureManager.VerifySignature(new FileInfo(opts.BinaryToVerify), opts.Signature); + var result = signatureManager.VerifySignature(new FileInfo(opts.BinaryToVerify), opts.Signature); #pragma warning disable CA2241 // Provide correct arguments to formatting methods if (result) { - Console.WriteLine($"Signature valid", Color.Green); + // ReSharper disable once FormatStringProblem + Console.WriteLine("Signature valid", Color.Green); } else { - Console.WriteLine($"Signature invalid", Color.Red); + // ReSharper disable once FormatStringProblem + Console.WriteLine("Signature invalid", Color.Red); } #pragma warning restore CA2241 // Provide correct arguments to formatting methods return; } - List binaries = new List(); + List binaries = []; foreach (var item in opts.Extension.Split(",", StringSplitOptions.RemoveEmptyEntries)) { var search = $"*.{item}"; @@ -162,6 +168,7 @@ private static void Run(Options opts) Console.WriteLine($"No files founds matching {search} in {opts.SourceBinaryDirectory}", Color.Yellow); Environment.Exit(1); } + binaries.AddRange(files); } @@ -200,8 +207,9 @@ private static void Run(Options opts) { os = "osx"; } + // - var item = new AppCastItem() + var item = new AppCastItem { Title = titleVersionInfo, DownloadLink = remoteUpdateFile, @@ -210,7 +218,7 @@ private static void Run(Options opts) PublicationDate = fileInfo.CreationTime, UpdateSize = fileInfo.Length, Description = "", - DownloadSignature = _signatureManager.KeysExist() ? _signatureManager.GetSignatureForFile(fileInfo) : null, + DownloadSignature = signatureManager.KeysExist() ? signatureManager.GetSignatureForFile(fileInfo) : null, OperatingSystemString = os, MIMEType = MimeTypes.GetMimeType(fileInfo.Name) }; @@ -224,7 +232,6 @@ private static void Run(Options opts) } var appcastXmlDocument = XMLAppCast.GenerateAppCastXml(items, "Irony Mod Manager"); - var appcastFileName = Path.Combine(outputDirectory, opts.AppCastFileName); var dirName = Path.GetDirectoryName(appcastFileName); @@ -232,7 +239,7 @@ private static void Run(Options opts) if (!Directory.Exists(dirName)) { Console.WriteLine("Creating {0}", dirName); - Directory.CreateDirectory(dirName); + Directory.CreateDirectory(dirName!); } Console.WriteLine("Writing appcast to {0}", appcastFileName); diff --git a/src/Irony.AppCastGenerator/SignatureManager.cs b/src/Irony.AppCastGenerator/SignatureManager.cs index 749b84e87..eeb4e4654 100644 --- a/src/Irony.AppCastGenerator/SignatureManager.cs +++ b/src/Irony.AppCastGenerator/SignatureManager.cs @@ -4,16 +4,18 @@ // Created : 09-14-2020 // // Last Modified By : Mario -// Last Modified On : 09-17-2020 +// Last Modified On : 12-07-2025 // *********************************************************************** // // NetSparkle // // // *********************************************************************** + using System; using System.Collections.Generic; using System.IO; +using System.Linq; using Org.BouncyCastle.Crypto; using Org.BouncyCastle.Crypto.Generators; using Org.BouncyCastle.Crypto.Parameters; @@ -42,17 +44,17 @@ public class SignatureManager /// /// The private key file path /// - private string _privateKeyFilePath; + private string privateKeyFilePath; /// /// The public key file path /// - private string _publicKeyFilePath; + private string publicKeyFilePath; /// /// The storage path /// - private string _storagePath; + private string storagePath; #endregion Fields @@ -95,13 +97,13 @@ public bool Generate(bool force = false) Ed25519PrivateKeyParameters privateKey = (Ed25519PrivateKeyParameters)kp.Private; Ed25519PublicKeyParameters publicKey = (Ed25519PublicKeyParameters)kp.Public; - var privKeyBase64 = Convert.ToBase64String(privateKey.GetEncoded()); + var privateKeyBase64 = Convert.ToBase64String(privateKey.GetEncoded()); var pubKeyBase64 = Convert.ToBase64String(publicKey.GetEncoded()); - File.WriteAllText(_privateKeyFilePath, privKeyBase64); - File.WriteAllText(_publicKeyFilePath, pubKeyBase64); + File.WriteAllText(privateKeyFilePath, privateKeyBase64); + File.WriteAllText(publicKeyFilePath, pubKeyBase64); - Console.WriteLine("Storing public/private keys to " + _storagePath); + Console.WriteLine("Storing public/private keys to " + storagePath); return true; } @@ -111,7 +113,7 @@ public bool Generate(bool force = false) /// System.Byte[]. public byte[] GetPrivateKey() { - return ResolveKeyLocation(PrivateKeyEnvironmentVariable, _privateKeyFilePath); + return ResolveKeyLocation(PrivateKeyEnvironmentVariable, privateKeyFilePath); } /// @@ -120,7 +122,7 @@ public byte[] GetPrivateKey() /// System.Byte[]. public byte[] GetPublicKey() { - return ResolveKeyLocation(PublicKeyEnvironmentVariable, _publicKeyFilePath); + return ResolveKeyLocation(PublicKeyEnvironmentVariable, publicKeyFilePath); } /// @@ -163,9 +165,9 @@ public string GetSignatureForFile(FileInfo file) } /// - /// Keyses the exist. + /// Checks if key exists. /// - /// true if XXXX, false otherwise. + /// true if key exists, false otherwise. public bool KeysExist() { if (GetPublicKey() != null && GetPrivateKey() != null) @@ -182,15 +184,16 @@ public bool KeysExist() /// The path. public void SetStorageDirectory(string path) { - _storagePath = path; + storagePath = path; - if (!Directory.Exists(_storagePath)) + if (!Directory.Exists(storagePath)) { - Directory.CreateDirectory(_storagePath); + Directory.CreateDirectory(storagePath!); } - _privateKeyFilePath = Path.Combine(_storagePath, "NetSparkle_Ed25519.priv"); - _publicKeyFilePath = Path.Combine(_storagePath, "NetSparkle_Ed25519.pub"); + // ReSharper disable once StringLiteralTypo + privateKeyFilePath = Path.Combine(storagePath, "NetSparkle_Ed25519.priv"); + publicKeyFilePath = Path.Combine(storagePath, "NetSparkle_Ed25519.pub"); } /// @@ -217,6 +220,7 @@ public bool VerifySignature(FileInfo file, string signature) Console.WriteLine("Keys do not exist"); return false; } + if (signature == null) { Console.WriteLine("Signature at path {0} is null", file.FullName); diff --git a/src/IronyModManager.Common/IronyModManager.Common.csproj b/src/IronyModManager.Common/IronyModManager.Common.csproj index cfa44499e..3772f5a96 100644 --- a/src/IronyModManager.Common/IronyModManager.Common.csproj +++ b/src/IronyModManager.Common/IronyModManager.Common.csproj @@ -18,7 +18,7 @@ x64 false - 1701;1702;NU1603 + 1701;1702;NU1603;CS8002 @@ -55,13 +55,12 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + diff --git a/src/IronyModManager.Common/ReactiveExtensions.cs b/src/IronyModManager.Common/ReactiveExtensions.cs new file mode 100644 index 000000000..9cb029de3 --- /dev/null +++ b/src/IronyModManager.Common/ReactiveExtensions.cs @@ -0,0 +1,52 @@ +// *********************************************************************** +// Assembly : IronyModManager.Common +// Author : Mario +// Created : 12-08-2025 +// +// Last Modified By : Mario +// Last Modified On : 12-08-2025 +// *********************************************************************** +// +// Mario +// +// +// *********************************************************************** + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reactive.Disposables; + +namespace ReactiveUI +{ + /// + /// Class ReactiveExtensions. + /// + public static class ReactiveExtensions + { + #region Methods + + // Why is this here? ReactiveUI decided to remove it just cause... + /// + /// Ensures the provided disposable is disposed with the specified System.Reactive.Disposables.CompositeDisposable. + /// + /// The type of the disposable. + /// The disposable we are going to want to be disposed by the CompositeDisposable. + /// The composite disposable. + /// T. + /// compositeDisposable + public static T DisposeWith(this T item, CompositeDisposable compositeDisposable) where T : IDisposable + { + switch (compositeDisposable) + { + case null: + throw new ArgumentNullException(nameof(compositeDisposable)); + default: + compositeDisposable.Add(item); + return item; + } + } + + #endregion Methods + } +} diff --git a/src/IronyModManager.Common/ViewModels/BaseViewModel.cs b/src/IronyModManager.Common/ViewModels/BaseViewModel.cs index c2f8351cb..75111d2a8 100644 --- a/src/IronyModManager.Common/ViewModels/BaseViewModel.cs +++ b/src/IronyModManager.Common/ViewModels/BaseViewModel.cs @@ -4,15 +4,17 @@ // Created : 01-10-2020 // // Last Modified By : Mario -// Last Modified On : 11-19-2020 +// Last Modified On : 12-08-2025 // *********************************************************************** // // Mario // // // *********************************************************************** + using System; using System.Collections.Generic; +using System.Linq; using System.Reactive.Disposables; using System.Threading.Tasks; using IronyModManager.Common.Events; @@ -54,7 +56,7 @@ public BaseViewModel() { Activator = DIResolver.Get(); MessageBus = DIResolver.Get(); - this.WhenActivated((CompositeDisposable disposables) => + this.WhenActivated(disposables => { Disposables = disposables; OnActivated(disposables); @@ -119,7 +121,7 @@ public virtual void OnLocaleChanged(string newLocale, string oldLocale) /// Name of the method. public void OnPropertyChanged(string methodName) { - IReactiveObjectExtensions.RaisePropertyChanged(this, methodName); + this.RaisePropertyChanged(methodName); } /// @@ -128,7 +130,7 @@ public void OnPropertyChanged(string methodName) /// Name of the method. public void OnPropertyChanging(string methodName) { - IReactiveObjectExtensions.RaisePropertyChanging(this, methodName); + this.RaisePropertyChanging(methodName); } /// @@ -179,13 +181,7 @@ protected virtual void TriggerOverlay(long id, bool isVisible, string message = /// Task. protected virtual async Task TriggerOverlayAsync(long id, bool isVisible, string message = Constants.EmptyParam, string progress = Constants.EmptyParam) { - var args = new OverlayProgressEvent() - { - Id = id, - IsVisible = isVisible, - Message = message, - MessageProgress = progress - }; + var args = new OverlayProgressEvent { Id = id, IsVisible = isVisible, Message = message, MessageProgress = progress }; await MessageBus.PublishAsync(args).ConfigureAwait(false); await Task.Run(() => { @@ -195,17 +191,14 @@ await Task.Run(() => } /// - /// Triggers the prevent shutdown. + /// Sends a message which prevents shutdown. /// - /// if set to true [cannot shutdown]. + /// if set to true prevents program shutdown. protected virtual void TriggerPreventShutdown(bool cannotShutdown) { Task.Run(() => { - var args = new ShutdownStateEventArgs() - { - PreventShutdown = cannotShutdown - }; + var args = new ShutdownStateEventArgs { PreventShutdown = cannotShutdown }; ReactiveUI.MessageBus.Current.SendMessage(args); }).ConfigureAwait(false); } diff --git a/src/IronyModManager.Common/Views/BaseControl.cs b/src/IronyModManager.Common/Views/BaseControl.cs index 851ea3239..45c557b02 100644 --- a/src/IronyModManager.Common/Views/BaseControl.cs +++ b/src/IronyModManager.Common/Views/BaseControl.cs @@ -4,15 +4,17 @@ // Created : 01-15-2020 // // Last Modified By : Mario -// Last Modified On : 06-23-2020 +// Last Modified On : 12-08-2025 // *********************************************************************** // // Mario // // // *********************************************************************** -using System.Collections.Generic; + using System; +using System.Collections.Generic; +using System.Linq; using System.Reactive.Disposables; using Avalonia; using Avalonia.Controls; diff --git a/src/IronyModManager.DI/IronyModManager.DI.csproj b/src/IronyModManager.DI/IronyModManager.DI.csproj index e48c948ad..ea9ed51b6 100644 --- a/src/IronyModManager.DI/IronyModManager.DI.csproj +++ b/src/IronyModManager.DI/IronyModManager.DI.csproj @@ -23,7 +23,7 @@ x64 false - 1701;1702;NU1603 + 1701;1702;NU1603;CS8002 @@ -54,17 +54,16 @@ - - + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + diff --git a/src/IronyModManager.DI/MessageBus/MessageBus.cs b/src/IronyModManager.DI/MessageBus/MessageBus.cs index 563406e48..e246df9fc 100644 --- a/src/IronyModManager.DI/MessageBus/MessageBus.cs +++ b/src/IronyModManager.DI/MessageBus/MessageBus.cs @@ -1,11 +1,10 @@ - -// *********************************************************************** +// *********************************************************************** // Assembly : IronyModManager.DI // Author : Mario // Created : 06-10-2020 // // Last Modified By : Mario -// Last Modified On : 06-25-2023 +// Last Modified On : 12-08-2025 // *********************************************************************** // // Mario @@ -15,12 +14,12 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Threading.Tasks; using IronyModManager.Shared.MessageBus; namespace IronyModManager.DI.MessageBus { - /// /// Class MessageBus. /// Implements the @@ -92,6 +91,7 @@ public Task PublishAsync(TMessage message) where TMessage : IMessageBu { return Task.CompletedTask; } + return messageBus.Publish(message); } diff --git a/src/IronyModManager.DI/MessageBus/MessageBusDependencyResolver.cs b/src/IronyModManager.DI/MessageBus/MessageBusDependencyResolver.cs index 5f5cf01a7..60f197114 100644 --- a/src/IronyModManager.DI/MessageBus/MessageBusDependencyResolver.cs +++ b/src/IronyModManager.DI/MessageBus/MessageBusDependencyResolver.cs @@ -4,7 +4,7 @@ // Created : 06-10-2020 // // Last Modified By : Mario -// Last Modified On : 10-29-2024 +// Last Modified On : 06-18-2025 // *********************************************************************** // // Mario diff --git a/src/IronyModManager.DI/MessageBus/MessageBusRegistration.cs b/src/IronyModManager.DI/MessageBus/MessageBusRegistration.cs index 59661c25f..695b6208a 100644 --- a/src/IronyModManager.DI/MessageBus/MessageBusRegistration.cs +++ b/src/IronyModManager.DI/MessageBus/MessageBusRegistration.cs @@ -1,11 +1,10 @@ - -// *********************************************************************** +// *********************************************************************** // Assembly : IronyModManager.DI // Author : Mario // Created : 06-10-2020 // // Last Modified By : Mario -// Last Modified On : 06-26-2023 +// Last Modified On : 12-08-2025 // *********************************************************************** // // Mario @@ -23,7 +22,6 @@ namespace IronyModManager.DI.MessageBus { - /// /// Class MessageBusRegistration. /// @@ -44,18 +42,22 @@ static object initCollectionObject(Type type) var instance = Activator.CreateInstance(genericListType); return instance; } + static Type resolveProducerInterceptor(Type type) { return typeof(IProducerInterceptor<>).MakeGenericType(type); } + static Type resolvePublishInterceptor(Type type) { return typeof(IPublishInterceptor<>).MakeGenericType(type); } + static Type resolveConsumerInterceptor(Type type) { return typeof(IConsumerInterceptor<>).MakeGenericType(type); } + static Type resolveEnumerable(Type type) { return typeof(IEnumerable<>).MakeGenericType(type); @@ -98,6 +100,7 @@ static Type resolveEnumerable(Type type) DIContainer.Container.Register(resolvedConsumerType, initResolvedConsumerType); registeredCollections.Add(resolvedConsumerType, initResolvedConsumerType); } + builder.Consume(find.EventType, x => x.Topic(x.ConsumerSettings.MessageType.Name).WithConsumer(find.HandlerType)); DIContainer.Container.Register(find.HandlerType, find.HandlerType, SimpleInjector.Lifestyle.Singleton); }); diff --git a/src/IronyModManager.DI/MessageBus/MessageBusValidationService.cs b/src/IronyModManager.DI/MessageBus/MessageBusValidationService.cs index 2069a2586..8f97e5fdb 100644 --- a/src/IronyModManager.DI/MessageBus/MessageBusValidationService.cs +++ b/src/IronyModManager.DI/MessageBus/MessageBusValidationService.cs @@ -1,28 +1,26 @@ - -// *********************************************************************** +// *********************************************************************** // Assembly : IronyModManager.DI // Author : Mario // Created : 02-09-2024 // // Last Modified By : Mario -// Last Modified On : 02-09-2024 +// Last Modified On : 12-08-2025 // *********************************************************************** // // Mario // // // *********************************************************************** + using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; using SlimMessageBus.Host; using SlimMessageBus.Host.Services; namespace IronyModManager.DI.MessageBus { - /// /// Class MessageBusValidationService. /// Implements the @@ -57,6 +55,7 @@ public override void AssertSettings() consumerSettings.ConsumerMethod = ReflectionUtils.GenerateMethodCallToFunc>(consumerSettings.ConsumerMethodInfo, consumerSettings.ConsumerType, typeof(Task), consumerSettings.MessageType); } } + base.AssertSettings(); } diff --git a/src/IronyModManager.GameHandler/IronyModManager.GameHandler.csproj b/src/IronyModManager.GameHandler/IronyModManager.GameHandler.csproj index 21d7839fe..3c5593c3f 100644 --- a/src/IronyModManager.GameHandler/IronyModManager.GameHandler.csproj +++ b/src/IronyModManager.GameHandler/IronyModManager.GameHandler.csproj @@ -16,7 +16,7 @@ x64 x64 false - 1701;1702;NU1603 + 1701;1702;NU1603;CS8002 @@ -59,10 +59,8 @@ - - - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -71,6 +69,12 @@ + + + + + ..\..\References\Conditional\Steamworks\.Net\Windows\Steamworks.NET.dll + diff --git a/src/IronyModManager.IO.Common/IronyModManager.IO.Common.csproj b/src/IronyModManager.IO.Common/IronyModManager.IO.Common.csproj index 0933492a1..7bfa47de4 100644 --- a/src/IronyModManager.IO.Common/IronyModManager.IO.Common.csproj +++ b/src/IronyModManager.IO.Common/IronyModManager.IO.Common.csproj @@ -15,7 +15,7 @@ x64 false - 1701;1702;NU1603 + 1701;1702;NU1603;CS8002 @@ -50,13 +50,12 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/src/IronyModManager.IO.Tests/IronyModManager.IO.Tests.csproj b/src/IronyModManager.IO.Tests/IronyModManager.IO.Tests.csproj index ce0813eb6..43941b931 100644 --- a/src/IronyModManager.IO.Tests/IronyModManager.IO.Tests.csproj +++ b/src/IronyModManager.IO.Tests/IronyModManager.IO.Tests.csproj @@ -15,7 +15,7 @@ x64 false - 1701;1702;NU1603;xUnit1004 + 1701;1702;NU1603;CS8002 @@ -37,16 +37,15 @@ - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/IronyModManager.IO.Tests/ReaderTests.cs b/src/IronyModManager.IO.Tests/ReaderTests.cs index c590234df..f36dcf556 100644 --- a/src/IronyModManager.IO.Tests/ReaderTests.cs +++ b/src/IronyModManager.IO.Tests/ReaderTests.cs @@ -18,7 +18,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.DI; using IronyModManager.IO.Common; using IronyModManager.IO.Common.Readers; diff --git a/src/IronyModManager.IO.Tests/StellarisDefinitionMergerTests.cs b/src/IronyModManager.IO.Tests/StellarisDefinitionMergerTests.cs index 2f5ed23cf..78bfe58ad 100644 --- a/src/IronyModManager.IO.Tests/StellarisDefinitionMergerTests.cs +++ b/src/IronyModManager.IO.Tests/StellarisDefinitionMergerTests.cs @@ -15,7 +15,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.IO.Mods.InfoProviders; using IronyModManager.Shared.Models; using IronyModManager.Parser.Definitions; diff --git a/src/IronyModManager.IO/Images/DDSDecoder.cs b/src/IronyModManager.IO/Images/DDSDecoder.cs index 90b1e8133..b467c3235 100644 --- a/src/IronyModManager.IO/Images/DDSDecoder.cs +++ b/src/IronyModManager.IO/Images/DDSDecoder.cs @@ -4,13 +4,14 @@ // Created : 02-17-2021 // // Last Modified By : Mario -// Last Modified On : 06-03-2022 +// Last Modified On : 12-07-2025 // *********************************************************************** // // Mario // // // *********************************************************************** + using System; using System.Collections.Generic; using System.IO; @@ -20,7 +21,7 @@ using BCnEncoder.Decoder.Options; using BCnEncoder.Shared; using BCnEncoder.Shared.ImageFiles; -using Microsoft.Toolkit.HighPerformance; +using CommunityToolkit.HighPerformance; using Pfim; using SixLabors.ImageSharp; using SixLabors.ImageSharp.PixelFormats; @@ -46,29 +47,34 @@ public Task DecodeStreamToImageAsync(Stream stream) { var ddsDecoder = new SixLabors.ImageSharp.Textures.Formats.Dds.DdsDecoder(); var texture = ddsDecoder.DecodeTexture(SixLabors.ImageSharp.Textures.Configuration.Default, stream); - if (texture is CubemapTexture cubemapTexture) - { - var right = cubemapTexture.PositiveX.MipMaps.FirstOrDefault().GetImage(); - var left = cubemapTexture.NegativeX.MipMaps.FirstOrDefault().GetImage(); - var top = cubemapTexture.PositiveY.MipMaps.FirstOrDefault().GetImage(); - var bottom = cubemapTexture.NegativeY.MipMaps.FirstOrDefault().GetImage(); - var front = cubemapTexture.PositiveZ.MipMaps.FirstOrDefault().GetImage(); - var back = cubemapTexture.NegativeZ.MipMaps.FirstOrDefault().GetImage(); - var image = GetCubeMap(right, left, top, bottom, front, back); - return Task.FromResult(image); - } - else if (texture is FlatTexture flatTexture) + switch (texture) { - // Dxt5 implementation has problems in this library (also the struct is internal) - var mipMap = flatTexture.MipMaps.FirstOrDefault(); - if (!mipMap.GetType().FullName.Contains("SixLabors.ImageSharp.Textures.TextureFormats.Decoding.Dxt5")) + case CubemapTexture cubemapTexture: { - var image = mipMap.GetImage(); + var right = cubemapTexture.PositiveX.MipMaps.FirstOrDefault()!.GetImage(); + var left = cubemapTexture.NegativeX.MipMaps.FirstOrDefault()!.GetImage(); + var top = cubemapTexture.PositiveY.MipMaps.FirstOrDefault()!.GetImage(); + var bottom = cubemapTexture.NegativeY.MipMaps.FirstOrDefault()!.GetImage(); + var front = cubemapTexture.PositiveZ.MipMaps.FirstOrDefault()!.GetImage(); + var back = cubemapTexture.NegativeZ.MipMaps.FirstOrDefault()!.GetImage(); + var image = GetCubeMap(right, left, top, bottom, front, back); return Task.FromResult(image); } + case FlatTexture flatTexture: + { + // Dxt5 implementation has problems in this library (also the struct is internal) + var mipMap = flatTexture.MipMaps.FirstOrDefault(); + if (mipMap != null && !mipMap.GetType().FullName!.Contains("SixLabors.ImageSharp.Textures.TextureFormats.Decoding.Dxt5")) + { + var image = mipMap.GetImage(); + return Task.FromResult(image); + } + + break; + } } - return Task.FromResult((Image)null); + return Task.FromResult(null); } /// @@ -123,6 +129,7 @@ public async Task DecodeToImageAsync(DdsFile file) var bcnImage = await decoder.Decode2DAsync(file); image = ColorMemoryToImage(bcnImage); } + return image; } @@ -140,8 +147,8 @@ public byte[] TightData(Dds image) return image.Data; } - byte[] newData = new byte[image.Height * tightStride]; - for (int i = 0; i < image.Height; i++) + var newData = new byte[image.Height * tightStride]; + for (var i = 0; i < image.Height; i++) { Buffer.BlockCopy(image.Data, i * image.Stride, newData, i * tightStride, tightStride); } @@ -166,6 +173,7 @@ private Image ColorMemoryToImage(Memory2D colors) var c = decodedPixels[i]; pixels[i] = new Rgba32(c.r, c.g, c.b, c.a); } + return output; } @@ -181,6 +189,7 @@ private CompressionFormat GetCompressionFormat(DdsFile file, DecoderInputOptions // Copied from BCnEncoder due to protection level var format = file.header.ddsPixelFormat.IsDxt10Format ? file.dx10Header.dxgiFormat : file.header.ddsPixelFormat.DxgiFormat; + // ReSharper disable once SwitchStatementHandlesSomeKnownEnumValuesWithDefault switch (format) { case DxgiFormat.DxgiFormatR8Unorm: @@ -198,40 +207,47 @@ private CompressionFormat GetCompressionFormat(DdsFile file, DecoderInputOptions return CompressionFormat.Bgra; case DxgiFormat.DxgiFormatBc1Unorm: + case DxgiFormat.DxgiFormatBc1UnormSrgb: + case DxgiFormat.DxgiFormatBc1Typeless: - if (file.header.ddsPixelFormat.dwFlags.HasFlag(PixelFormatFlags.DdpfAlphaPixels)) + if (file.header.ddsPixelFormat.dwFlags.HasFlag(PixelFormatFlags.DdpfAlphaPixels) || decoderInputOptions.DdsBc1ExpectAlpha) { return CompressionFormat.Bc1WithAlpha; } - if (decoderInputOptions.DdsBc1ExpectAlpha) - { - return CompressionFormat.Bc1WithAlpha; - } return CompressionFormat.Bc1; case DxgiFormat.DxgiFormatBc2Unorm: + case DxgiFormat.DxgiFormatBc2UnormSrgb: + case DxgiFormat.DxgiFormatBc2Typeless: return CompressionFormat.Bc2; case DxgiFormat.DxgiFormatBc3Unorm: + case DxgiFormat.DxgiFormatBc3UnormSrgb: + case DxgiFormat.DxgiFormatBc3Typeless: return CompressionFormat.Bc3; case DxgiFormat.DxgiFormatBc4Unorm: + case DxgiFormat.DxgiFormatBc4Snorm: + case DxgiFormat.DxgiFormatBc4Typeless: return CompressionFormat.Bc4; case DxgiFormat.DxgiFormatBc5Unorm: + case DxgiFormat.DxgiFormatBc5Snorm: + case DxgiFormat.DxgiFormatBc5Typeless: return CompressionFormat.Bc5; case DxgiFormat.DxgiFormatBc6HTypeless: + case DxgiFormat.DxgiFormatBc6HUf16: return CompressionFormat.Bc6U; @@ -239,7 +255,9 @@ private CompressionFormat GetCompressionFormat(DdsFile file, DecoderInputOptions return CompressionFormat.Bc6S; case DxgiFormat.DxgiFormatBc7Unorm: + case DxgiFormat.DxgiFormatBc7UnormSrgb: + case DxgiFormat.DxgiFormatBc7Typeless: return CompressionFormat.Bc7; diff --git a/src/IronyModManager.IO/IronyModManager.IO.csproj b/src/IronyModManager.IO/IronyModManager.IO.csproj index 8d6adef5c..71bff0497 100644 --- a/src/IronyModManager.IO/IronyModManager.IO.csproj +++ b/src/IronyModManager.IO/IronyModManager.IO.csproj @@ -16,7 +16,7 @@ x64 false - 1701;1702;NU1603 + 1701;1702;NU1603;CS8002 @@ -51,26 +51,25 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - + + + + + - - - - + + + @@ -84,8 +83,8 @@ ..\..\References\Direct\LiteDB.dll - - ..\..\References\Direct\ProDotNetZip.dll + + ..\..\References\Conditional\Steamworks\.Net\Windows\Steamworks.NET.dll diff --git a/src/IronyModManager.Localization.Tests/AutoRefreshLocalizationAttributeHandlerTests.cs b/src/IronyModManager.Localization.Tests/AutoRefreshLocalizationAttributeHandlerTests.cs index 38b696dba..ef510aa9d 100644 --- a/src/IronyModManager.Localization.Tests/AutoRefreshLocalizationAttributeHandlerTests.cs +++ b/src/IronyModManager.Localization.Tests/AutoRefreshLocalizationAttributeHandlerTests.cs @@ -14,7 +14,7 @@ using System; using System.Collections.Generic; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Localization.Attributes; using IronyModManager.Localization.Attributes.Handlers; using Xunit; diff --git a/src/IronyModManager.Localization.Tests/DynamicLocalizationAttributeHandlerTests.cs b/src/IronyModManager.Localization.Tests/DynamicLocalizationAttributeHandlerTests.cs index 0c2ce5532..0942e3920 100644 --- a/src/IronyModManager.Localization.Tests/DynamicLocalizationAttributeHandlerTests.cs +++ b/src/IronyModManager.Localization.Tests/DynamicLocalizationAttributeHandlerTests.cs @@ -14,7 +14,7 @@ using System; using System.Collections.Generic; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Localization.Attributes; using IronyModManager.Localization.Attributes.Handlers; using IronyModManager.Tests.Common; diff --git a/src/IronyModManager.Localization.Tests/IronyModManager.Localization.Tests.csproj b/src/IronyModManager.Localization.Tests/IronyModManager.Localization.Tests.csproj index 440e7e8ec..3798687dd 100644 --- a/src/IronyModManager.Localization.Tests/IronyModManager.Localization.Tests.csproj +++ b/src/IronyModManager.Localization.Tests/IronyModManager.Localization.Tests.csproj @@ -14,7 +14,7 @@ x64 false - 1701;1702;NU1603;xUnit1004 + 1701;1702;NU1603;xUnit1004;CS8002 @@ -36,16 +36,15 @@ - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/IronyModManager.Localization.Tests/LocalizationCollectionRefreshHandlerTests.cs b/src/IronyModManager.Localization.Tests/LocalizationCollectionRefreshHandlerTests.cs index aa07b9be8..bd357b4db 100644 --- a/src/IronyModManager.Localization.Tests/LocalizationCollectionRefreshHandlerTests.cs +++ b/src/IronyModManager.Localization.Tests/LocalizationCollectionRefreshHandlerTests.cs @@ -16,7 +16,7 @@ using System.ComponentModel; using System.Linq; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Localization.Attributes; using IronyModManager.Localization.Attributes.Handlers; using IronyModManager.Tests.Common; diff --git a/src/IronyModManager.Localization.Tests/LocalizationInterceptorTests.cs b/src/IronyModManager.Localization.Tests/LocalizationInterceptorTests.cs index 7dafa8abe..2c0535e85 100644 --- a/src/IronyModManager.Localization.Tests/LocalizationInterceptorTests.cs +++ b/src/IronyModManager.Localization.Tests/LocalizationInterceptorTests.cs @@ -15,7 +15,7 @@ using System.Collections.Generic; using System.ComponentModel; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.DI; using IronyModManager.Localization.Attributes; using IronyModManager.Localization.Attributes.Handlers; diff --git a/src/IronyModManager.Localization.Tests/LocalizationManagerTests.cs b/src/IronyModManager.Localization.Tests/LocalizationManagerTests.cs index bb15809af..69f61c9e4 100644 --- a/src/IronyModManager.Localization.Tests/LocalizationManagerTests.cs +++ b/src/IronyModManager.Localization.Tests/LocalizationManagerTests.cs @@ -14,7 +14,7 @@ using System; using System.Collections.Generic; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Localization.ResourceProviders; using IronyModManager.Shared.Cache; using Moq; diff --git a/src/IronyModManager.Localization.Tests/LocalizationModelRefreshHandlerTests.cs b/src/IronyModManager.Localization.Tests/LocalizationModelRefreshHandlerTests.cs index db9e96d49..b6ca9e74a 100644 --- a/src/IronyModManager.Localization.Tests/LocalizationModelRefreshHandlerTests.cs +++ b/src/IronyModManager.Localization.Tests/LocalizationModelRefreshHandlerTests.cs @@ -16,7 +16,7 @@ using System.ComponentModel; using System.Linq; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Localization.Attributes; using IronyModManager.Localization.Attributes.Handlers; using IronyModManager.Tests.Common; diff --git a/src/IronyModManager.Localization.Tests/StaticLocalizationAttributeHandlerTests.cs b/src/IronyModManager.Localization.Tests/StaticLocalizationAttributeHandlerTests.cs index 5296d0310..256e8dc75 100644 --- a/src/IronyModManager.Localization.Tests/StaticLocalizationAttributeHandlerTests.cs +++ b/src/IronyModManager.Localization.Tests/StaticLocalizationAttributeHandlerTests.cs @@ -14,7 +14,7 @@ using System; using System.Collections.Generic; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Localization.Attributes; using IronyModManager.Localization.Attributes.Handlers; using IronyModManager.Tests.Common; diff --git a/src/IronyModManager.Localization/IronyModManager.Localization.csproj b/src/IronyModManager.Localization/IronyModManager.Localization.csproj index d977fb061..c5ca732a4 100644 --- a/src/IronyModManager.Localization/IronyModManager.Localization.csproj +++ b/src/IronyModManager.Localization/IronyModManager.Localization.csproj @@ -17,7 +17,7 @@ x64 false - 1701;1702;NU1603 + 1701;1702;NU1603;CS8002 @@ -51,16 +51,15 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + diff --git a/src/IronyModManager.Model.Tests/IronyModManager.Model.Tests.csproj b/src/IronyModManager.Model.Tests/IronyModManager.Model.Tests.csproj index 7f4a9300b..f523bc0a1 100644 --- a/src/IronyModManager.Model.Tests/IronyModManager.Model.Tests.csproj +++ b/src/IronyModManager.Model.Tests/IronyModManager.Model.Tests.csproj @@ -14,7 +14,7 @@ x64 false - 1701;1702;NU1603;xUnit1004 + 1701;1702;NU1603;xUnit1004;CS8002 @@ -36,15 +36,14 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/IronyModManager.Model.Tests/PropertyChangedTests.cs b/src/IronyModManager.Model.Tests/PropertyChangedTests.cs index 21a972793..3433d6aab 100644 --- a/src/IronyModManager.Model.Tests/PropertyChangedTests.cs +++ b/src/IronyModManager.Model.Tests/PropertyChangedTests.cs @@ -15,7 +15,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.DI; using IronyModManager.Models; using IronyModManager.Models.Common; diff --git a/src/IronyModManager.Models.Common/IronyModManager.Models.Common.csproj b/src/IronyModManager.Models.Common/IronyModManager.Models.Common.csproj index cc50c7093..14f9e2d6d 100644 --- a/src/IronyModManager.Models.Common/IronyModManager.Models.Common.csproj +++ b/src/IronyModManager.Models.Common/IronyModManager.Models.Common.csproj @@ -16,7 +16,7 @@ x64 false - 1701;1702;NU1603 + 1701;1702;NU1603;CS8002 @@ -50,13 +50,12 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/src/IronyModManager.Models/IronyModManager.Models.csproj b/src/IronyModManager.Models/IronyModManager.Models.csproj index 1f957d2ae..5c4bfd2a5 100644 --- a/src/IronyModManager.Models/IronyModManager.Models.csproj +++ b/src/IronyModManager.Models/IronyModManager.Models.csproj @@ -22,7 +22,7 @@ x64 false - 1701;1702;NU1603 + 1701;1702;NU1603;CS8002 @@ -56,14 +56,13 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + diff --git a/src/IronyModManager.Parser.Common/IronyModManager.Parser.Common.csproj b/src/IronyModManager.Parser.Common/IronyModManager.Parser.Common.csproj index d29dc7f5e..679a8ae3c 100644 --- a/src/IronyModManager.Parser.Common/IronyModManager.Parser.Common.csproj +++ b/src/IronyModManager.Parser.Common/IronyModManager.Parser.Common.csproj @@ -16,7 +16,7 @@ x64 false - 1701;1702;NU1603 + 1701;1702;NU1603;CS8002 @@ -52,11 +52,10 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/src/IronyModManager.Parser.Tests/BoolConverterTests.cs b/src/IronyModManager.Parser.Tests/BoolConverterTests.cs index 4c5b80e1c..3b93b783a 100644 --- a/src/IronyModManager.Parser.Tests/BoolConverterTests.cs +++ b/src/IronyModManager.Parser.Tests/BoolConverterTests.cs @@ -16,7 +16,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.Common.Mod.Search; using IronyModManager.Parser.Mod.Search; using IronyModManager.Parser.Mod.Search.Converter; diff --git a/src/IronyModManager.Parser.Tests/DLCParserTests.cs b/src/IronyModManager.Parser.Tests/DLCParserTests.cs index 9eea60043..00b328b76 100644 --- a/src/IronyModManager.Parser.Tests/DLCParserTests.cs +++ b/src/IronyModManager.Parser.Tests/DLCParserTests.cs @@ -16,7 +16,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.DLC; using IronyModManager.Tests.Common; using Xunit; diff --git a/src/IronyModManager.Parser.Tests/DefaultParserTests.cs b/src/IronyModManager.Parser.Tests/DefaultParserTests.cs index 720fac1cc..1caf92563 100644 --- a/src/IronyModManager.Parser.Tests/DefaultParserTests.cs +++ b/src/IronyModManager.Parser.Tests/DefaultParserTests.cs @@ -15,7 +15,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.Common.Args; using IronyModManager.Parser.Default; using IronyModManager.Shared; diff --git a/src/IronyModManager.Parser.Tests/GenericBinaryParserTests.cs b/src/IronyModManager.Parser.Tests/GenericBinaryParserTests.cs index fff29b2d9..00d20c81d 100644 --- a/src/IronyModManager.Parser.Tests/GenericBinaryParserTests.cs +++ b/src/IronyModManager.Parser.Tests/GenericBinaryParserTests.cs @@ -15,7 +15,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.Common.Args; using IronyModManager.Parser.Generic; using IronyModManager.Tests.Common; diff --git a/src/IronyModManager.Parser.Tests/GenericDefinesParserTests.cs b/src/IronyModManager.Parser.Tests/GenericDefinesParserTests.cs index 8e40337bb..4732fa186 100644 --- a/src/IronyModManager.Parser.Tests/GenericDefinesParserTests.cs +++ b/src/IronyModManager.Parser.Tests/GenericDefinesParserTests.cs @@ -15,7 +15,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.Common.Args; using IronyModManager.Shared; using IronyModManager.Tests.Common; diff --git a/src/IronyModManager.Parser.Tests/GenericGraphicsParserTests.cs b/src/IronyModManager.Parser.Tests/GenericGraphicsParserTests.cs index 23d384f15..bfc9c027d 100644 --- a/src/IronyModManager.Parser.Tests/GenericGraphicsParserTests.cs +++ b/src/IronyModManager.Parser.Tests/GenericGraphicsParserTests.cs @@ -15,7 +15,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.Common.Args; using IronyModManager.Parser.Generic; using IronyModManager.Shared; diff --git a/src/IronyModManager.Parser.Tests/GenericKeyParserTests.cs b/src/IronyModManager.Parser.Tests/GenericKeyParserTests.cs index 1af908b29..60fec1993 100644 --- a/src/IronyModManager.Parser.Tests/GenericKeyParserTests.cs +++ b/src/IronyModManager.Parser.Tests/GenericKeyParserTests.cs @@ -15,7 +15,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.Common.Args; using IronyModManager.Parser.Generic; using IronyModManager.Shared; diff --git a/src/IronyModManager.Parser.Tests/GenericLocalizationParserTests.cs b/src/IronyModManager.Parser.Tests/GenericLocalizationParserTests.cs index 3d0e0ae59..6aec8d80f 100644 --- a/src/IronyModManager.Parser.Tests/GenericLocalizationParserTests.cs +++ b/src/IronyModManager.Parser.Tests/GenericLocalizationParserTests.cs @@ -15,7 +15,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.Common.Args; using IronyModManager.Parser.Generic; using IronyModManager.Tests.Common; diff --git a/src/IronyModManager.Parser.Tests/GenericWholeTextParserTests.cs b/src/IronyModManager.Parser.Tests/GenericWholeTextParserTests.cs index 448f5e485..29ae61c7d 100644 --- a/src/IronyModManager.Parser.Tests/GenericWholeTextParserTests.cs +++ b/src/IronyModManager.Parser.Tests/GenericWholeTextParserTests.cs @@ -15,7 +15,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.Common.Args; using IronyModManager.Parser.Generic; using IronyModManager.Shared; diff --git a/src/IronyModManager.Parser.Tests/HOI4InnerLayerParserTests.cs b/src/IronyModManager.Parser.Tests/HOI4InnerLayerParserTests.cs index e1d48175f..a8f9bc2ca 100644 --- a/src/IronyModManager.Parser.Tests/HOI4InnerLayerParserTests.cs +++ b/src/IronyModManager.Parser.Tests/HOI4InnerLayerParserTests.cs @@ -16,7 +16,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.Common.Args; using IronyModManager.Tests.Common; using Xunit; diff --git a/src/IronyModManager.Parser.Tests/HOI4KeyParserTests.cs b/src/IronyModManager.Parser.Tests/HOI4KeyParserTests.cs index 5de05568f..2789d1eee 100644 --- a/src/IronyModManager.Parser.Tests/HOI4KeyParserTests.cs +++ b/src/IronyModManager.Parser.Tests/HOI4KeyParserTests.cs @@ -15,7 +15,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.Common.Args; using IronyModManager.Tests.Common; using Xunit; diff --git a/src/IronyModManager.Parser.Tests/HOI4KeyValuePairParserTests.cs b/src/IronyModManager.Parser.Tests/HOI4KeyValuePairParserTests.cs index ec1874826..1a188cce7 100644 --- a/src/IronyModManager.Parser.Tests/HOI4KeyValuePairParserTests.cs +++ b/src/IronyModManager.Parser.Tests/HOI4KeyValuePairParserTests.cs @@ -16,7 +16,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.Common.Args; using IronyModManager.Tests.Common; using Xunit; diff --git a/src/IronyModManager.Parser.Tests/HOI4WholeTextParserTests.cs b/src/IronyModManager.Parser.Tests/HOI4WholeTextParserTests.cs index 493fabcb3..f2daa30c0 100644 --- a/src/IronyModManager.Parser.Tests/HOI4WholeTextParserTests.cs +++ b/src/IronyModManager.Parser.Tests/HOI4WholeTextParserTests.cs @@ -15,7 +15,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.Common.Args; using IronyModManager.Parser.Games.HOI4; using IronyModManager.Tests.Common; diff --git a/src/IronyModManager.Parser.Tests/IndexedDefinitionsTests.cs b/src/IronyModManager.Parser.Tests/IndexedDefinitionsTests.cs index 403092fca..9dcdbcaa9 100644 --- a/src/IronyModManager.Parser.Tests/IndexedDefinitionsTests.cs +++ b/src/IronyModManager.Parser.Tests/IndexedDefinitionsTests.cs @@ -17,7 +17,7 @@ using System.IO; using System.Linq; using System.Threading.Tasks; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.Definitions; using IronyModManager.Shared.Models; using IronyModManager.Tests.Common; diff --git a/src/IronyModManager.Parser.Tests/IronyModManager.Parser.Tests.csproj b/src/IronyModManager.Parser.Tests/IronyModManager.Parser.Tests.csproj index 6ce270a4a..f8c1dd3b0 100644 --- a/src/IronyModManager.Parser.Tests/IronyModManager.Parser.Tests.csproj +++ b/src/IronyModManager.Parser.Tests/IronyModManager.Parser.Tests.csproj @@ -15,7 +15,7 @@ x64 false - 1701;1702;NU1603;xUnit1004 + 1701;1702;NU1603;xUnit1004;CS8002 @@ -53,19 +53,18 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/IronyModManager.Parser.Tests/LocalizationRegistryTests.cs b/src/IronyModManager.Parser.Tests/LocalizationRegistryTests.cs index 2e3dae9ec..eb8b636f4 100644 --- a/src/IronyModManager.Parser.Tests/LocalizationRegistryTests.cs +++ b/src/IronyModManager.Parser.Tests/LocalizationRegistryTests.cs @@ -16,7 +16,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.Common.Mod.Search; using IronyModManager.Parser.Games.Stellaris; using IronyModManager.Parser.Mod.Search; diff --git a/src/IronyModManager.Parser.Tests/ModParserTests.cs b/src/IronyModManager.Parser.Tests/ModParserTests.cs index 9c810381a..0cb68528f 100644 --- a/src/IronyModManager.Parser.Tests/ModParserTests.cs +++ b/src/IronyModManager.Parser.Tests/ModParserTests.cs @@ -16,7 +16,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.Mod; using IronyModManager.Tests.Common; using Xunit; diff --git a/src/IronyModManager.Parser.Tests/ParametrizedParserTests.cs b/src/IronyModManager.Parser.Tests/ParametrizedParserTests.cs index ba3753f17..2ba01de3d 100644 --- a/src/IronyModManager.Parser.Tests/ParametrizedParserTests.cs +++ b/src/IronyModManager.Parser.Tests/ParametrizedParserTests.cs @@ -16,7 +16,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.DI; using IronyModManager.Localization; using IronyModManager.Parser.Common; diff --git a/src/IronyModManager.Parser.Tests/ParserManagerTests.cs b/src/IronyModManager.Parser.Tests/ParserManagerTests.cs index 5787bf64a..b7f93beeb 100644 --- a/src/IronyModManager.Parser.Tests/ParserManagerTests.cs +++ b/src/IronyModManager.Parser.Tests/ParserManagerTests.cs @@ -15,7 +15,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.Common.Args; using IronyModManager.Parser.Common.Parsers; using IronyModManager.Parser.Definitions; diff --git a/src/IronyModManager.Parser.Tests/ParserMergerTests.cs b/src/IronyModManager.Parser.Tests/ParserMergerTests.cs index ea0a31ee5..90255469c 100644 --- a/src/IronyModManager.Parser.Tests/ParserMergerTests.cs +++ b/src/IronyModManager.Parser.Tests/ParserMergerTests.cs @@ -16,7 +16,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.Common.Args; using IronyModManager.Shared; using IronyModManager.Tests.Common; diff --git a/src/IronyModManager.Parser.Tests/SearchParserTests.cs b/src/IronyModManager.Parser.Tests/SearchParserTests.cs index fa1f56bb8..105df0483 100644 --- a/src/IronyModManager.Parser.Tests/SearchParserTests.cs +++ b/src/IronyModManager.Parser.Tests/SearchParserTests.cs @@ -16,7 +16,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.Common.Mod.Search.Converter; using IronyModManager.Parser.Mod.Search; using IronyModManager.Parser.Mod.Search.Converter; diff --git a/src/IronyModManager.Parser.Tests/SourceTypeConverterTests.cs b/src/IronyModManager.Parser.Tests/SourceTypeConverterTests.cs index 6e4333d36..2433c24f7 100644 --- a/src/IronyModManager.Parser.Tests/SourceTypeConverterTests.cs +++ b/src/IronyModManager.Parser.Tests/SourceTypeConverterTests.cs @@ -17,7 +17,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.Common.Mod.Search; using IronyModManager.Parser.Mod.Search; using IronyModManager.Parser.Mod.Search.Converter; diff --git a/src/IronyModManager.Parser.Tests/StellarisDefinesParserTests.cs b/src/IronyModManager.Parser.Tests/StellarisDefinesParserTests.cs index b63ab0746..af9cf8ec3 100644 --- a/src/IronyModManager.Parser.Tests/StellarisDefinesParserTests.cs +++ b/src/IronyModManager.Parser.Tests/StellarisDefinesParserTests.cs @@ -16,7 +16,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.Common.Args; using IronyModManager.Tests.Common; using Xunit; diff --git a/src/IronyModManager.Parser.Tests/StellarisFlagParserTests.cs b/src/IronyModManager.Parser.Tests/StellarisFlagParserTests.cs index fe929c7e3..b47ee17d6 100644 --- a/src/IronyModManager.Parser.Tests/StellarisFlagParserTests.cs +++ b/src/IronyModManager.Parser.Tests/StellarisFlagParserTests.cs @@ -15,7 +15,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.Common.Args; using IronyModManager.Tests.Common; using Xunit; diff --git a/src/IronyModManager.Parser.Tests/StellarisKeyParserTests.cs b/src/IronyModManager.Parser.Tests/StellarisKeyParserTests.cs index d712113b3..bd0f45c80 100644 --- a/src/IronyModManager.Parser.Tests/StellarisKeyParserTests.cs +++ b/src/IronyModManager.Parser.Tests/StellarisKeyParserTests.cs @@ -16,7 +16,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.Common.Args; using IronyModManager.Tests.Common; using Xunit; diff --git a/src/IronyModManager.Parser.Tests/StellarisOverwrittenObjectSingleFileParserTests.cs b/src/IronyModManager.Parser.Tests/StellarisOverwrittenObjectSingleFileParserTests.cs index 0c1dd3990..47648c472 100644 --- a/src/IronyModManager.Parser.Tests/StellarisOverwrittenObjectSingleFileParserTests.cs +++ b/src/IronyModManager.Parser.Tests/StellarisOverwrittenObjectSingleFileParserTests.cs @@ -16,7 +16,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.Common.Args; using IronyModManager.Parser.Games.Stellaris; using IronyModManager.Shared; diff --git a/src/IronyModManager.Parser.Tests/StellarisOverwrittenParserTests.cs b/src/IronyModManager.Parser.Tests/StellarisOverwrittenParserTests.cs index 19d744dde..7f06bb1c6 100644 --- a/src/IronyModManager.Parser.Tests/StellarisOverwrittenParserTests.cs +++ b/src/IronyModManager.Parser.Tests/StellarisOverwrittenParserTests.cs @@ -15,7 +15,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.Common.Args; using IronyModManager.Parser.Games.Stellaris; using IronyModManager.Shared; diff --git a/src/IronyModManager.Parser.Tests/StellarisScriptedVariablesTest.cs b/src/IronyModManager.Parser.Tests/StellarisScriptedVariablesTest.cs index 5faa604ac..1ccdffeb2 100644 --- a/src/IronyModManager.Parser.Tests/StellarisScriptedVariablesTest.cs +++ b/src/IronyModManager.Parser.Tests/StellarisScriptedVariablesTest.cs @@ -16,7 +16,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.Common.Args; using IronyModManager.Parser.Games.Stellaris; using IronyModManager.Shared; diff --git a/src/IronyModManager.Parser.Tests/StellarisSolarSystemInitializersTests.cs b/src/IronyModManager.Parser.Tests/StellarisSolarSystemInitializersTests.cs index d1ee66399..5ea1d27d7 100644 --- a/src/IronyModManager.Parser.Tests/StellarisSolarSystemInitializersTests.cs +++ b/src/IronyModManager.Parser.Tests/StellarisSolarSystemInitializersTests.cs @@ -15,7 +15,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.Common.Args; using IronyModManager.Parser.Games.Stellaris; using IronyModManager.Shared; diff --git a/src/IronyModManager.Parser.Tests/StellarisWholeTextParserTests.cs b/src/IronyModManager.Parser.Tests/StellarisWholeTextParserTests.cs index 73c0ce5f6..8b0001d40 100644 --- a/src/IronyModManager.Parser.Tests/StellarisWholeTextParserTests.cs +++ b/src/IronyModManager.Parser.Tests/StellarisWholeTextParserTests.cs @@ -16,7 +16,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.Common.Args; using IronyModManager.Parser.Games.Stellaris; using IronyModManager.Tests.Common; diff --git a/src/IronyModManager.Parser.Tests/ValidationParserTests.cs b/src/IronyModManager.Parser.Tests/ValidationParserTests.cs index faf9f3d81..8755359be 100644 --- a/src/IronyModManager.Parser.Tests/ValidationParserTests.cs +++ b/src/IronyModManager.Parser.Tests/ValidationParserTests.cs @@ -3,7 +3,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.Common.Args; using IronyModManager.Tests.Common; using Xunit; diff --git a/src/IronyModManager.Parser.Tests/VersionConverterTests.cs b/src/IronyModManager.Parser.Tests/VersionConverterTests.cs index 5c73c0547..be51985b5 100644 --- a/src/IronyModManager.Parser.Tests/VersionConverterTests.cs +++ b/src/IronyModManager.Parser.Tests/VersionConverterTests.cs @@ -17,7 +17,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Parser.Common.Mod.Search; using IronyModManager.Parser.Mod.Search; using IronyModManager.Parser.Mod.Search.Converter; diff --git a/src/IronyModManager.Parser/IronyModManager.Parser.csproj b/src/IronyModManager.Parser/IronyModManager.Parser.csproj index fa5b1e984..684071cd6 100644 --- a/src/IronyModManager.Parser/IronyModManager.Parser.csproj +++ b/src/IronyModManager.Parser/IronyModManager.Parser.csproj @@ -16,7 +16,7 @@ x64 false - 1701;1702;NU1603 + 1701;1702;NU1603;CS8002 @@ -51,14 +51,13 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + diff --git a/src/IronyModManager.Platform/IronyModManager.Platform.csproj b/src/IronyModManager.Platform/IronyModManager.Platform.csproj index a6aa15bcc..c81be1b7a 100644 --- a/src/IronyModManager.Platform/IronyModManager.Platform.csproj +++ b/src/IronyModManager.Platform/IronyModManager.Platform.csproj @@ -15,7 +15,7 @@ x64 false - 1701;1702;NU1603 + 1701;1702;NU1603;CS8002 @@ -70,13 +70,12 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + diff --git a/src/IronyModManager.Services.Common/IronyModManager.Services.Common.csproj b/src/IronyModManager.Services.Common/IronyModManager.Services.Common.csproj index 19186a219..06f04a283 100644 --- a/src/IronyModManager.Services.Common/IronyModManager.Services.Common.csproj +++ b/src/IronyModManager.Services.Common/IronyModManager.Services.Common.csproj @@ -16,7 +16,7 @@ x64 false - 1701;1702;NU1603 + 1701;1702;NU1603;CS8002 @@ -51,11 +51,10 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/src/IronyModManager.Services.Tests/AppStateServiceTests.cs b/src/IronyModManager.Services.Tests/AppStateServiceTests.cs index 1c659f162..cb7e03931 100644 --- a/src/IronyModManager.Services.Tests/AppStateServiceTests.cs +++ b/src/IronyModManager.Services.Tests/AppStateServiceTests.cs @@ -15,7 +15,7 @@ using System.Collections.Generic; using System.Text; using AutoMapper; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Models; using IronyModManager.Models.Common; using IronyModManager.Services; diff --git a/src/IronyModManager.Services.Tests/ConflictSolverColorsServiceTests.cs b/src/IronyModManager.Services.Tests/ConflictSolverColorsServiceTests.cs index 24c7cc191..7bfea3118 100644 --- a/src/IronyModManager.Services.Tests/ConflictSolverColorsServiceTests.cs +++ b/src/IronyModManager.Services.Tests/ConflictSolverColorsServiceTests.cs @@ -16,7 +16,7 @@ using System.Collections.Generic; using System.Linq; using AutoMapper; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Localization; using IronyModManager.Models; using IronyModManager.Models.Common; diff --git a/src/IronyModManager.Services.Tests/DLCServiceTests.cs b/src/IronyModManager.Services.Tests/DLCServiceTests.cs index 34b4ab71f..be642081b 100644 --- a/src/IronyModManager.Services.Tests/DLCServiceTests.cs +++ b/src/IronyModManager.Services.Tests/DLCServiceTests.cs @@ -18,7 +18,7 @@ using System.Text; using System.Threading.Tasks; using AutoMapper; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.DI.Extensions; using IronyModManager.IO; using IronyModManager.IO.Common.DLC; diff --git a/src/IronyModManager.Services.Tests/ExternalEditorServiceTests.cs b/src/IronyModManager.Services.Tests/ExternalEditorServiceTests.cs index 989a436dc..954460fa9 100644 --- a/src/IronyModManager.Services.Tests/ExternalEditorServiceTests.cs +++ b/src/IronyModManager.Services.Tests/ExternalEditorServiceTests.cs @@ -17,7 +17,7 @@ using System.Text; using System.Threading.Tasks; using AutoMapper; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.DI.Extensions; using IronyModManager.Models; using IronyModManager.Models.Common; diff --git a/src/IronyModManager.Services.Tests/ExternalProcessHandlerServiceTests.cs b/src/IronyModManager.Services.Tests/ExternalProcessHandlerServiceTests.cs index 4af0d3ae7..5524fd0f5 100644 --- a/src/IronyModManager.Services.Tests/ExternalProcessHandlerServiceTests.cs +++ b/src/IronyModManager.Services.Tests/ExternalProcessHandlerServiceTests.cs @@ -17,7 +17,7 @@ using System.Linq; using System.Threading.Tasks; using AutoMapper; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.IO.Common.Platforms; using IronyModManager.Models; using IronyModManager.Shared.Configuration; diff --git a/src/IronyModManager.Services.Tests/GameIndexServiceTests.cs b/src/IronyModManager.Services.Tests/GameIndexServiceTests.cs index 6f63ea687..1b3ad38f1 100644 --- a/src/IronyModManager.Services.Tests/GameIndexServiceTests.cs +++ b/src/IronyModManager.Services.Tests/GameIndexServiceTests.cs @@ -18,7 +18,7 @@ using System.Linq; using System.Threading.Tasks; using AutoMapper; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.IO; using IronyModManager.IO.Common.Game; using IronyModManager.IO.Common.Mods; diff --git a/src/IronyModManager.Services.Tests/GameLanguageServiceTests.cs b/src/IronyModManager.Services.Tests/GameLanguageServiceTests.cs index 0f80ccda0..d62ddac2b 100644 --- a/src/IronyModManager.Services.Tests/GameLanguageServiceTests.cs +++ b/src/IronyModManager.Services.Tests/GameLanguageServiceTests.cs @@ -15,7 +15,7 @@ using System; using System.Collections.Generic; using System.Linq; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Localization; using IronyModManager.Models; using IronyModManager.Models.Common; diff --git a/src/IronyModManager.Services.Tests/GameServiceTests.cs b/src/IronyModManager.Services.Tests/GameServiceTests.cs index 6352e66b8..630ca085e 100644 --- a/src/IronyModManager.Services.Tests/GameServiceTests.cs +++ b/src/IronyModManager.Services.Tests/GameServiceTests.cs @@ -19,7 +19,7 @@ using System.Reflection; using System.Threading.Tasks; using AutoMapper; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.IO.Common.Readers; using IronyModManager.Models; using IronyModManager.Models.Common; diff --git a/src/IronyModManager.Services.Tests/IronyModManager.Services.Tests.csproj b/src/IronyModManager.Services.Tests/IronyModManager.Services.Tests.csproj index 805008d8e..dc231521d 100644 --- a/src/IronyModManager.Services.Tests/IronyModManager.Services.Tests.csproj +++ b/src/IronyModManager.Services.Tests/IronyModManager.Services.Tests.csproj @@ -15,7 +15,7 @@ x64 false - 1701;1702;NU1603;xUnit1004 + 1701;1702;NU1603;xUnit1004;CS8002 @@ -53,15 +53,14 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/IronyModManager.Services.Tests/LanguageServiceTests.cs b/src/IronyModManager.Services.Tests/LanguageServiceTests.cs index 26f912be7..1b954a7fe 100644 --- a/src/IronyModManager.Services.Tests/LanguageServiceTests.cs +++ b/src/IronyModManager.Services.Tests/LanguageServiceTests.cs @@ -16,7 +16,7 @@ using System.Linq; using System.Text; using AutoMapper; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Localization; using IronyModManager.Localization.ResourceProviders; using IronyModManager.Models; diff --git a/src/IronyModManager.Services.Tests/ModCollectionServiceTests.cs b/src/IronyModManager.Services.Tests/ModCollectionServiceTests.cs index e988feb3d..590c12d2e 100644 --- a/src/IronyModManager.Services.Tests/ModCollectionServiceTests.cs +++ b/src/IronyModManager.Services.Tests/ModCollectionServiceTests.cs @@ -17,7 +17,7 @@ using System.Text; using System.Threading.Tasks; using AutoMapper; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.IO; using IronyModManager.IO.Common; using IronyModManager.IO.Common.Models; diff --git a/src/IronyModManager.Services.Tests/ModMergeServiceTests.cs b/src/IronyModManager.Services.Tests/ModMergeServiceTests.cs index 3564328a7..16798816c 100644 --- a/src/IronyModManager.Services.Tests/ModMergeServiceTests.cs +++ b/src/IronyModManager.Services.Tests/ModMergeServiceTests.cs @@ -17,7 +17,7 @@ using System.Linq; using System.Threading.Tasks; using AutoMapper; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.IO; using IronyModManager.IO.Common; using IronyModManager.IO.Common.Mods; diff --git a/src/IronyModManager.Services.Tests/ModPatchCollectionServiceTests.cs b/src/IronyModManager.Services.Tests/ModPatchCollectionServiceTests.cs index 6d745de64..e5b2c49f8 100644 --- a/src/IronyModManager.Services.Tests/ModPatchCollectionServiceTests.cs +++ b/src/IronyModManager.Services.Tests/ModPatchCollectionServiceTests.cs @@ -19,7 +19,7 @@ using System.Reflection; using System.Threading.Tasks; using AutoMapper; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.IO.Common.Mods; using IronyModManager.IO.Common.Readers; using IronyModManager.IO.Mods.Models; diff --git a/src/IronyModManager.Services.Tests/ModServiceTests.cs b/src/IronyModManager.Services.Tests/ModServiceTests.cs index 27500c29e..f58e265b4 100644 --- a/src/IronyModManager.Services.Tests/ModServiceTests.cs +++ b/src/IronyModManager.Services.Tests/ModServiceTests.cs @@ -19,7 +19,7 @@ using System.Linq; using System.Threading.Tasks; using AutoMapper; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.IO.Common.Mods; using IronyModManager.IO.Common.Readers; using IronyModManager.Localization; diff --git a/src/IronyModManager.Services.Tests/NotificationPositionSettingsServiceTests.cs b/src/IronyModManager.Services.Tests/NotificationPositionSettingsServiceTests.cs index 6565b7d6a..a0296e8c6 100644 --- a/src/IronyModManager.Services.Tests/NotificationPositionSettingsServiceTests.cs +++ b/src/IronyModManager.Services.Tests/NotificationPositionSettingsServiceTests.cs @@ -17,7 +17,7 @@ using System.Text; using System.Threading.Tasks; using AutoMapper; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Models; using IronyModManager.Models.Common; using IronyModManager.Services.Common; diff --git a/src/IronyModManager.Services.Tests/PermissionCheckServiceTests.cs b/src/IronyModManager.Services.Tests/PermissionCheckServiceTests.cs index bd8b91155..0e9fe2802 100644 --- a/src/IronyModManager.Services.Tests/PermissionCheckServiceTests.cs +++ b/src/IronyModManager.Services.Tests/PermissionCheckServiceTests.cs @@ -17,7 +17,7 @@ using System.Text; using System.Threading.Tasks; using AutoMapper; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.DI.Extensions; using IronyModManager.Models; using IronyModManager.Models.Common; diff --git a/src/IronyModManager.Services.Tests/PreferencesServiceTests.cs b/src/IronyModManager.Services.Tests/PreferencesServiceTests.cs index 787eaea4b..158dbf40f 100644 --- a/src/IronyModManager.Services.Tests/PreferencesServiceTests.cs +++ b/src/IronyModManager.Services.Tests/PreferencesServiceTests.cs @@ -15,7 +15,7 @@ using System.Collections.Generic; using System.Text; using AutoMapper; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Models; using IronyModManager.Models.Common; using IronyModManager.Services; diff --git a/src/IronyModManager.Services.Tests/PromptNotificationsServiceTests.cs b/src/IronyModManager.Services.Tests/PromptNotificationsServiceTests.cs index 93fbab8bb..9ff63445a 100644 --- a/src/IronyModManager.Services.Tests/PromptNotificationsServiceTests.cs +++ b/src/IronyModManager.Services.Tests/PromptNotificationsServiceTests.cs @@ -17,7 +17,7 @@ using System.Text; using System.Threading.Tasks; using AutoMapper; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Localization; using IronyModManager.Models; using IronyModManager.Models.Common; diff --git a/src/IronyModManager.Services.Tests/ReportExportServiceTests.cs b/src/IronyModManager.Services.Tests/ReportExportServiceTests.cs index 10ce2d118..7f3747ef3 100644 --- a/src/IronyModManager.Services.Tests/ReportExportServiceTests.cs +++ b/src/IronyModManager.Services.Tests/ReportExportServiceTests.cs @@ -17,7 +17,7 @@ using System.Text; using System.Threading.Tasks; using AutoMapper; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.IO.Common; using IronyModManager.Models; using IronyModManager.Models.Common; diff --git a/src/IronyModManager.Services.Tests/ThemeServiceTests.cs b/src/IronyModManager.Services.Tests/ThemeServiceTests.cs index ad13c452b..d4ef6a827 100644 --- a/src/IronyModManager.Services.Tests/ThemeServiceTests.cs +++ b/src/IronyModManager.Services.Tests/ThemeServiceTests.cs @@ -16,7 +16,7 @@ using System.Linq; using System.Text; using AutoMapper; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Models; using IronyModManager.Models.Common; using IronyModManager.Services.Common; diff --git a/src/IronyModManager.Services.Tests/UpdaterServiceTests.cs b/src/IronyModManager.Services.Tests/UpdaterServiceTests.cs index 74404b596..94250bc47 100644 --- a/src/IronyModManager.Services.Tests/UpdaterServiceTests.cs +++ b/src/IronyModManager.Services.Tests/UpdaterServiceTests.cs @@ -17,7 +17,7 @@ using System.Text; using System.Threading.Tasks; using AutoMapper; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.IO.Common.Updater; using IronyModManager.Localization; using IronyModManager.Localization.ResourceProviders; diff --git a/src/IronyModManager.Services.Tests/WindowStateServiceTests.cs b/src/IronyModManager.Services.Tests/WindowStateServiceTests.cs index 63f17a7db..2544cd46a 100644 --- a/src/IronyModManager.Services.Tests/WindowStateServiceTests.cs +++ b/src/IronyModManager.Services.Tests/WindowStateServiceTests.cs @@ -15,7 +15,7 @@ using System.Collections.Generic; using System.Text; using AutoMapper; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Models; using IronyModManager.Models.Common; using IronyModManager.Storage.Common; diff --git a/src/IronyModManager.Services/IronyModManager.Services.csproj b/src/IronyModManager.Services/IronyModManager.Services.csproj index ee7bf2756..b1d27f965 100644 --- a/src/IronyModManager.Services/IronyModManager.Services.csproj +++ b/src/IronyModManager.Services/IronyModManager.Services.csproj @@ -21,7 +21,7 @@ x64 false - 1701;1702;NU1603 + 1701;1702;NU1603;CS8002 @@ -55,17 +55,16 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + diff --git a/src/IronyModManager.Services/ModPatchCollectionService.cs b/src/IronyModManager.Services/ModPatchCollectionService.cs index ff1c54883..c370a9d5c 100644 --- a/src/IronyModManager.Services/ModPatchCollectionService.cs +++ b/src/IronyModManager.Services/ModPatchCollectionService.cs @@ -4,7 +4,7 @@ // Created : 05-26-2020 // // Last Modified By : Mario -// Last Modified On : 12-02-2025 +// Last Modified On : 12-08-2025 // *********************************************************************** // // Mario @@ -3651,7 +3651,7 @@ await modPatchExporter.ExportDefinitionAsync(new ModPatchExporterParameters { Game = game.Type, OverwrittenConflicts = - PopulateModPath(await overwritten.ToAsyncEnumerable().WhereAwait(async p => !(await conflictResult.ResolvedConflicts.GetByTypeAndIdAsync(p.TypeAndId)).Any()).ToListAsync(), + PopulateModPath(await overwritten.ToAsyncEnumerable().Where(async (p, _) => !(await conflictResult.ResolvedConflicts.GetByTypeAndIdAsync(p.TypeAndId)).Any()).ToListAsync(), collectionMods), RootPath = GetModDirectoryRootPath(game), PatchPath = EvaluatePatchNamePath(game, patchName) diff --git a/src/IronyModManager.Shared/FileSignatureUtility.cs b/src/IronyModManager.Shared/FileSignatureUtility.cs index 57cb523eb..74fc85c85 100644 --- a/src/IronyModManager.Shared/FileSignatureUtility.cs +++ b/src/IronyModManager.Shared/FileSignatureUtility.cs @@ -4,13 +4,14 @@ // Created : 07-20-2022 // // Last Modified By : Mario -// Last Modified On : 10-29-2022 +// Last Modified On : 12-08-2025 // *********************************************************************** // // Mario // // // *********************************************************************** + using System; using System.Collections.Generic; using System.IO; @@ -28,12 +29,17 @@ public static class FileSignatureUtility /// /// The image identifier /// - private static readonly string[] ImageIds = new[] { "image" }; + private static readonly string[] imageIds = ["image"]; /// /// The text identifier /// - private static readonly string[] TextIds = new[] { "text", "application/json" }; + private static readonly string[] textIds = ["text", "application/json"]; + + /// + /// The whitelisted text extensions + /// + private static readonly string[] whitelistedTextExtensions = [".mod"]; #endregion Fields @@ -46,7 +52,7 @@ public static class FileSignatureUtility /// true if [is image file] [the specified filename]; otherwise, false. public static bool IsImageFile(string filename) { - return IsOfType(filename, ImageIds, Constants.ImageExtensions); + return IsOfType(filename, imageIds, Constants.ImageExtensions); } /// @@ -57,7 +63,7 @@ public static bool IsImageFile(string filename) /// true if [is text file] [the specified filename]; otherwise, false. public static bool IsTextFile(string filename, Stream stream) { - return IsOfType(filename, stream, TextIds, Constants.TextExtensions); + return IsOfType(filename, stream, textIds, Constants.TextExtensions); } /// @@ -67,7 +73,7 @@ public static bool IsTextFile(string filename, Stream stream) /// true if [is text file] [the specified filename]; otherwise, false. public static bool IsTextFile(string filename) { - return IsOfType(filename, TextIds, Constants.TextExtensions); + return IsOfType(filename, textIds, Constants.TextExtensions); } /// @@ -84,12 +90,19 @@ private static bool IsOfType(string filename, Stream stream, string[] ids, strin { return false; } + var ms = new MemoryStream(); stream.Seek(0, SeekOrigin.Begin); stream.CopyTo(ms); stream.Seek(0, SeekOrigin.Begin); ms.Seek(0, SeekOrigin.Begin); - if (PommaLabs.MimeTypes.MimeTypeMap.TryGetMimeType(ms, Path.GetFileName(filename), out var mimeType)) + if (whitelistedTextExtensions.Any(e => filename.EndsWith(e, StringComparison.OrdinalIgnoreCase) && extensions.Any(a => a.Equals(e, StringComparison.OrdinalIgnoreCase)))) + { + ms.Close(); + ms.Dispose(); + return true; + } + else if (PommaLabs.MimeTypes.MimeTypeMap.TryGetMimeType(ms, Path.GetFileName(filename), out var mimeType)) { var result = ids.Any(p => mimeType.StartsWith(p, StringComparison.OrdinalIgnoreCase) && IsValidTextFile(ms)); ms.Close(); @@ -106,6 +119,7 @@ private static bool IsOfType(string filename, Stream stream, string[] ids, strin return ids.Any(p => mimeType.StartsWith(p, StringComparison.OrdinalIgnoreCase)); } } + ms.Close(); ms.Dispose(); return extensions.Any(s => s.EndsWith(filename, StringComparison.OrdinalIgnoreCase)); @@ -120,7 +134,11 @@ private static bool IsOfType(string filename, Stream stream, string[] ids, strin /// true if [is of type] [the specified filename]; otherwise, false. private static bool IsOfType(string filename, string[] ids, string[] extensions) { - if (PommaLabs.MimeTypes.MimeTypeMap.TryGetMimeType(Path.GetFileName(filename), out var mimeType)) + if (whitelistedTextExtensions.Any(e => filename.EndsWith(e, StringComparison.OrdinalIgnoreCase) && extensions.Any(a => a.Equals(e, StringComparison.OrdinalIgnoreCase)))) + { + return true; + } + else if (PommaLabs.MimeTypes.MimeTypeMap.TryGetMimeType(Path.GetFileName(filename), out var mimeType)) { return ids.Any(p => mimeType.StartsWith(p, StringComparison.OrdinalIgnoreCase)); } @@ -132,6 +150,7 @@ private static bool IsOfType(string filename, string[] ids, string[] extensions) return ids.Any(p => mimeType.StartsWith(p, StringComparison.OrdinalIgnoreCase)); } } + return extensions.Any(s => s.EndsWith(filename, StringComparison.OrdinalIgnoreCase)); } @@ -149,6 +168,7 @@ private static bool IsValidTextFile(Stream stream) { return true; } + stream.Seek(-512, SeekOrigin.End); var buffer = new byte[512]; var byteCount = stream.Read(buffer, 0, buffer.Length); @@ -160,6 +180,7 @@ private static bool IsValidTextFile(Stream stream) return false; } } + return true; } catch diff --git a/src/IronyModManager.Shared/IronyModManager.Shared.csproj b/src/IronyModManager.Shared/IronyModManager.Shared.csproj index 9122509cb..7007c6b67 100644 --- a/src/IronyModManager.Shared/IronyModManager.Shared.csproj +++ b/src/IronyModManager.Shared/IronyModManager.Shared.csproj @@ -16,7 +16,7 @@ x64 false - 1701;1702;NU1603 + 1701;1702;NU1603;CS8002 @@ -50,29 +50,28 @@ - - - + + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - - - + + + - + diff --git a/src/IronyModManager.Shared/MessageBus/BaseMessageBusConsumer.cs b/src/IronyModManager.Shared/MessageBus/BaseMessageBusConsumer.cs index c71c69820..4ae811a43 100644 --- a/src/IronyModManager.Shared/MessageBus/BaseMessageBusConsumer.cs +++ b/src/IronyModManager.Shared/MessageBus/BaseMessageBusConsumer.cs @@ -4,16 +4,18 @@ // Created : 06-10-2020 // // Last Modified By : Mario -// Last Modified On : 11-14-2022 +// Last Modified On : 12-08-2025 // *********************************************************************** // // Mario // // // *********************************************************************** + using System; using System.Collections.Concurrent; using System.Collections.Generic; +using System.Linq; using System.Threading.Tasks; namespace IronyModManager.Shared.MessageBus @@ -70,6 +72,7 @@ public virtual async Task OnHandle(TMessage message) await Task.Delay(25); taskCache.TryGetValue(awaitableEvent, out tasksCompleted); } + taskCache.Remove(awaitableEvent, out _); } } @@ -132,10 +135,7 @@ public virtual IDisposable Subscribe(Func> action) /// The awaitable event. protected virtual void IncrementTaskCounter(BaseAwaitableEvent awaitableEvent) { - taskCache.AddOrUpdate(awaitableEvent, 1, (key, oldValue) => - { - return oldValue + 1; - }); + taskCache.AddOrUpdate(awaitableEvent, 1, (_, oldValue) => oldValue + 1); } #endregion Methods diff --git a/src/IronyModManager.Storage.Common/IronyModManager.Storage.Common.csproj b/src/IronyModManager.Storage.Common/IronyModManager.Storage.Common.csproj index 9f88e1a70..342015364 100644 --- a/src/IronyModManager.Storage.Common/IronyModManager.Storage.Common.csproj +++ b/src/IronyModManager.Storage.Common/IronyModManager.Storage.Common.csproj @@ -16,7 +16,7 @@ x64 false - 1701;1702;NU1603 + 1701;1702;NU1603;CS8002 @@ -50,14 +50,13 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + diff --git a/src/IronyModManager.Storage.Tests/IronyModManager.Storage.Tests.csproj b/src/IronyModManager.Storage.Tests/IronyModManager.Storage.Tests.csproj index f38c6445b..3f1b9f01c 100644 --- a/src/IronyModManager.Storage.Tests/IronyModManager.Storage.Tests.csproj +++ b/src/IronyModManager.Storage.Tests/IronyModManager.Storage.Tests.csproj @@ -15,7 +15,7 @@ x64 false - 1701;1702;NU1603;xUnit1004 + 1701;1702;NU1603;xUnit1004;CS8002 @@ -53,15 +53,14 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/IronyModManager.Storage.Tests/PropertyChangedTests.cs b/src/IronyModManager.Storage.Tests/PropertyChangedTests.cs index 5320fdaff..a11cdc6ee 100644 --- a/src/IronyModManager.Storage.Tests/PropertyChangedTests.cs +++ b/src/IronyModManager.Storage.Tests/PropertyChangedTests.cs @@ -15,7 +15,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.DI; using IronyModManager.Localization; using IronyModManager.Models; diff --git a/src/IronyModManager.Storage.Tests/StorageTests.cs b/src/IronyModManager.Storage.Tests/StorageTests.cs index 1f43b2f50..27ecad351 100644 --- a/src/IronyModManager.Storage.Tests/StorageTests.cs +++ b/src/IronyModManager.Storage.Tests/StorageTests.cs @@ -16,7 +16,7 @@ using System.Collections.Generic; using System.Linq; using AutoMapper; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.DI; using IronyModManager.Models; using IronyModManager.Models.Common; diff --git a/src/IronyModManager.Storage/IronyModManager.Storage.csproj b/src/IronyModManager.Storage/IronyModManager.Storage.csproj index 10b65ccf7..83efb579c 100644 --- a/src/IronyModManager.Storage/IronyModManager.Storage.csproj +++ b/src/IronyModManager.Storage/IronyModManager.Storage.csproj @@ -23,7 +23,7 @@ x64 false - 1701;1702;NU1603 + 1701;1702;NU1603;CS8002 @@ -57,17 +57,16 @@ - - + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + diff --git a/src/IronyModManager.Storage/Store/JsonStore.cs b/src/IronyModManager.Storage/Store/JsonStore.cs index ea870a230..4516a9e2b 100644 --- a/src/IronyModManager.Storage/Store/JsonStore.cs +++ b/src/IronyModManager.Storage/Store/JsonStore.cs @@ -4,7 +4,7 @@ // Created : 01-20-2020 // // Last Modified By : Mario -// Last Modified On : 12-06-2025 +// Last Modified On : 12-07-2025 // *********************************************************************** // // Mario @@ -250,10 +250,10 @@ private string GetFilePath(string id, bool lookForOlderVersion = false) if (lookForOlderVersion) { - if (storageItem == null && Directory.Exists(mainPath)) + if (storageItem == null && Directory.Exists(RootPath)) { var dbs = new List(); - foreach (var item in Directory.EnumerateFiles(mainPath, $"*{Shared.Constants.JsonExtension}")) + foreach (var item in Directory.EnumerateFiles(RootPath, $"*{Shared.Constants.JsonExtension}")) { if (item.Contains('_', StringComparison.OrdinalIgnoreCase)) { diff --git a/src/IronyModManager.Tests.Common/IronyModManager.Tests.Common.csproj b/src/IronyModManager.Tests.Common/IronyModManager.Tests.Common.csproj index 73c57b805..54384c66b 100644 --- a/src/IronyModManager.Tests.Common/IronyModManager.Tests.Common.csproj +++ b/src/IronyModManager.Tests.Common/IronyModManager.Tests.Common.csproj @@ -15,7 +15,7 @@ x64 false - 1701;1702;NU1603;xUnit1004 + 1701;1702;NU1603;CS8002 True @@ -52,16 +52,16 @@ - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/IronyModManager.Tests/AchievementStatusCompatibleConverterTests.cs b/src/IronyModManager.Tests/AchievementStatusCompatibleConverterTests.cs index 2558b8fcb..ac3b9c0d1 100644 --- a/src/IronyModManager.Tests/AchievementStatusCompatibleConverterTests.cs +++ b/src/IronyModManager.Tests/AchievementStatusCompatibleConverterTests.cs @@ -14,7 +14,7 @@ using System; using System.Collections.Generic; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Converters; using IronyModManager.Models.Common; using Xunit; diff --git a/src/IronyModManager.Tests/AchievementStatusNotCompatibleConverterTests.cs b/src/IronyModManager.Tests/AchievementStatusNotCompatibleConverterTests.cs index 9d1d7b239..3bf79fa9f 100644 --- a/src/IronyModManager.Tests/AchievementStatusNotCompatibleConverterTests.cs +++ b/src/IronyModManager.Tests/AchievementStatusNotCompatibleConverterTests.cs @@ -14,7 +14,7 @@ using System; using System.Collections.Generic; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Converters; using IronyModManager.Models.Common; using Xunit; diff --git a/src/IronyModManager.Tests/BoolAndConverterTests.cs b/src/IronyModManager.Tests/BoolAndConverterTests.cs index a6f1c2e92..100ac0750 100644 --- a/src/IronyModManager.Tests/BoolAndConverterTests.cs +++ b/src/IronyModManager.Tests/BoolAndConverterTests.cs @@ -14,7 +14,7 @@ using System; using System.Collections.Generic; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Converters; using Xunit; diff --git a/src/IronyModManager.Tests/CollectionNullOrEmptyConverterTests.cs b/src/IronyModManager.Tests/CollectionNullOrEmptyConverterTests.cs index 15cd1689b..247e4fd72 100644 --- a/src/IronyModManager.Tests/CollectionNullOrEmptyConverterTests.cs +++ b/src/IronyModManager.Tests/CollectionNullOrEmptyConverterTests.cs @@ -14,7 +14,7 @@ using System; using System.Collections.Generic; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Converters; using Xunit; diff --git a/src/IronyModManager.Tests/DefinitionFileTooltipConverterTests.cs b/src/IronyModManager.Tests/DefinitionFileTooltipConverterTests.cs index 63eb318da..7cdfc1472 100644 --- a/src/IronyModManager.Tests/DefinitionFileTooltipConverterTests.cs +++ b/src/IronyModManager.Tests/DefinitionFileTooltipConverterTests.cs @@ -14,7 +14,7 @@ using System; using System.Collections.Generic; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Converters; using IronyModManager.Parser.Definitions; using IronyModManager.Services.Common; diff --git a/src/IronyModManager.Tests/DefinitionPriorityClassConverterTests.cs b/src/IronyModManager.Tests/DefinitionPriorityClassConverterTests.cs index 088725dde..b26095b3c 100644 --- a/src/IronyModManager.Tests/DefinitionPriorityClassConverterTests.cs +++ b/src/IronyModManager.Tests/DefinitionPriorityClassConverterTests.cs @@ -14,7 +14,7 @@ using System; using System.Collections.Generic; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Converters; using IronyModManager.Models; using IronyModManager.Parser.Definitions; diff --git a/src/IronyModManager.Tests/DefinitionPriorityTextConverterTests.cs b/src/IronyModManager.Tests/DefinitionPriorityTextConverterTests.cs index 547b358a2..82a5cc9c5 100644 --- a/src/IronyModManager.Tests/DefinitionPriorityTextConverterTests.cs +++ b/src/IronyModManager.Tests/DefinitionPriorityTextConverterTests.cs @@ -14,7 +14,7 @@ using System; using System.Collections.Generic; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Converters; using IronyModManager.Localization; using IronyModManager.Models; diff --git a/src/IronyModManager.Tests/DefinitionResetConverterTests.cs b/src/IronyModManager.Tests/DefinitionResetConverterTests.cs index b6234f526..06c0777df 100644 --- a/src/IronyModManager.Tests/DefinitionResetConverterTests.cs +++ b/src/IronyModManager.Tests/DefinitionResetConverterTests.cs @@ -16,7 +16,7 @@ using System.Collections.Generic; using System.Text; using DiffPlex.DiffBuilder.Model; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Converters; using IronyModManager.Parser.Definitions; using Xunit; diff --git a/src/IronyModManager.Tests/DiffLineConverterTests.cs b/src/IronyModManager.Tests/DiffLineConverterTests.cs index aec6a0f20..7366392e1 100644 --- a/src/IronyModManager.Tests/DiffLineConverterTests.cs +++ b/src/IronyModManager.Tests/DiffLineConverterTests.cs @@ -15,7 +15,7 @@ using System.Collections.Generic; using System.Text; using DiffPlex.DiffBuilder.Model; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Converters; using Xunit; diff --git a/src/IronyModManager.Tests/DiffSubPieceConverterTests.cs b/src/IronyModManager.Tests/DiffSubPieceConverterTests.cs index 239f8736d..2c41f521b 100644 --- a/src/IronyModManager.Tests/DiffSubPieceConverterTests.cs +++ b/src/IronyModManager.Tests/DiffSubPieceConverterTests.cs @@ -15,7 +15,7 @@ using System.Collections.Generic; using System.Text; using DiffPlex.DiffBuilder.Model; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Converters; using Xunit; namespace IronyModManager.Tests diff --git a/src/IronyModManager.Tests/FontFamilyConverterTests.cs b/src/IronyModManager.Tests/FontFamilyConverterTests.cs index 97b579865..9ba8ffdf1 100644 --- a/src/IronyModManager.Tests/FontFamilyConverterTests.cs +++ b/src/IronyModManager.Tests/FontFamilyConverterTests.cs @@ -14,7 +14,7 @@ using System; using System.Collections.Generic; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Converters; using IronyModManager.Fonts; using IronyModManager.Localization; diff --git a/src/IronyModManager.Tests/IronyModManager.Tests.csproj b/src/IronyModManager.Tests/IronyModManager.Tests.csproj index be6134813..125911b52 100644 --- a/src/IronyModManager.Tests/IronyModManager.Tests.csproj +++ b/src/IronyModManager.Tests/IronyModManager.Tests.csproj @@ -15,7 +15,7 @@ x64 false - 1701;1702;NU1603;xUnit1004 + 1701;1702;NU1603;xUnit1004;CS8002 @@ -37,16 +37,15 @@ - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/IronyModManager.Tests/LocalModConverterTests.cs b/src/IronyModManager.Tests/LocalModConverterTests.cs index 7e9eae0aa..de9a0fbb8 100644 --- a/src/IronyModManager.Tests/LocalModConverterTests.cs +++ b/src/IronyModManager.Tests/LocalModConverterTests.cs @@ -15,7 +15,7 @@ using System; using System.Collections.Generic; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Converters; using IronyModManager.Models.Common; using Xunit; diff --git a/src/IronyModManager.Tests/LocalizationConverterTests.cs b/src/IronyModManager.Tests/LocalizationConverterTests.cs index 24bd44b37..e6efd726f 100644 --- a/src/IronyModManager.Tests/LocalizationConverterTests.cs +++ b/src/IronyModManager.Tests/LocalizationConverterTests.cs @@ -14,7 +14,7 @@ using System; using System.Collections.Generic; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Converters; using IronyModManager.Localization; using IronyModManager.Tests.Common; diff --git a/src/IronyModManager.Tests/LocalizationResourceProviderTests.cs b/src/IronyModManager.Tests/LocalizationResourceProviderTests.cs index 8cd20dcb3..8ff0644d8 100644 --- a/src/IronyModManager.Tests/LocalizationResourceProviderTests.cs +++ b/src/IronyModManager.Tests/LocalizationResourceProviderTests.cs @@ -16,7 +16,7 @@ using System.IO; using System.Linq; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Implementation; using Xunit; diff --git a/src/IronyModManager.Tests/MathConverterTests.cs b/src/IronyModManager.Tests/MathConverterTests.cs index 0be2146f6..1c9a96039 100644 --- a/src/IronyModManager.Tests/MathConverterTests.cs +++ b/src/IronyModManager.Tests/MathConverterTests.cs @@ -14,7 +14,7 @@ using System; using System.Collections.Generic; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Converters; using IronyModManager.Localization; using IronyModManager.Tests.Common; diff --git a/src/IronyModManager.Tests/ParadoxModConverterTests.cs b/src/IronyModManager.Tests/ParadoxModConverterTests.cs index 59f27b23c..a7a5718b6 100644 --- a/src/IronyModManager.Tests/ParadoxModConverterTests.cs +++ b/src/IronyModManager.Tests/ParadoxModConverterTests.cs @@ -15,7 +15,7 @@ using System; using System.Collections.Generic; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Converters; using IronyModManager.Models.Common; using Xunit; diff --git a/src/IronyModManager.Tests/SteamModConverterTests.cs b/src/IronyModManager.Tests/SteamModConverterTests.cs index ca30dcf9d..3375b9e47 100644 --- a/src/IronyModManager.Tests/SteamModConverterTests.cs +++ b/src/IronyModManager.Tests/SteamModConverterTests.cs @@ -15,7 +15,7 @@ using System; using System.Collections.Generic; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Converters; using IronyModManager.Models.Common; using Xunit; diff --git a/src/IronyModManager.Tests/TextTypeFontFamilyConverterTests.cs b/src/IronyModManager.Tests/TextTypeFontFamilyConverterTests.cs index 4cb28faa8..b83fedfcb 100644 --- a/src/IronyModManager.Tests/TextTypeFontFamilyConverterTests.cs +++ b/src/IronyModManager.Tests/TextTypeFontFamilyConverterTests.cs @@ -15,7 +15,7 @@ using System; using System.Collections.Generic; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Converters; using IronyModManager.Fonts; using IronyModManager.Localization; diff --git a/src/IronyModManager.Tests/ViewLocatorTests.cs b/src/IronyModManager.Tests/ViewLocatorTests.cs index dc3d54939..feb9cacc2 100644 --- a/src/IronyModManager.Tests/ViewLocatorTests.cs +++ b/src/IronyModManager.Tests/ViewLocatorTests.cs @@ -15,7 +15,7 @@ using System.Collections.Generic; using System.Text; using Avalonia.Controls; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Common; using IronyModManager.Common.ViewModels; using IronyModManager.Common.Views; diff --git a/src/IronyModManager.Tests/ViewResolverTests.cs b/src/IronyModManager.Tests/ViewResolverTests.cs index 680a182a7..92462f1e9 100644 --- a/src/IronyModManager.Tests/ViewResolverTests.cs +++ b/src/IronyModManager.Tests/ViewResolverTests.cs @@ -14,7 +14,7 @@ using System; using System.Collections.Generic; using System.Text; -using FluentAssertions; +using AwesomeAssertions; using IronyModManager.Localization; using IronyModManager.Tests.Common; using IronyModManager.Tests.Views; diff --git a/src/IronyModManager.Updater/IronyModManager.Updater.csproj b/src/IronyModManager.Updater/IronyModManager.Updater.csproj index 774f2d82c..82e6bb8ce 100644 --- a/src/IronyModManager.Updater/IronyModManager.Updater.csproj +++ b/src/IronyModManager.Updater/IronyModManager.Updater.csproj @@ -16,7 +16,7 @@ x64 x64 false - 1701;1702;NU1603 + 1701;1702;NU1603;CS8002 @@ -51,12 +51,11 @@ - - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/IronyModManager/Implementation/Updater/IronyAppCast.cs b/src/IronyModManager/Implementation/Updater/IronyAppCast.cs index 0e8be1761..6481b133d 100644 --- a/src/IronyModManager/Implementation/Updater/IronyAppCast.cs +++ b/src/IronyModManager/Implementation/Updater/IronyAppCast.cs @@ -4,13 +4,14 @@ // Created : 09-16-2020 // // Last Modified By : Mario -// Last Modified On : 09-20-2020 +// Last Modified On : 12-07-2025 // *********************************************************************** // // Mario // // // *********************************************************************** + using System; using System.Collections.Generic; using System.Linq; @@ -37,7 +38,7 @@ public class IronyAppCast : IAppCastHandler /// /// The prerelease version tags /// - private static readonly string[] prereleaseVersionTags = new string[] { "alpha", "beta", "preview", "rc" }; + private static readonly string[] prereleaseVersionTags = ["alpha", "beta", "preview", "rc"]; /// /// The application cast @@ -68,7 +69,7 @@ public class IronyAppCast : IAppCastHandler /// /// if set to true [is installer version]. /// The updater service. - public IronyAppCast(bool isInstallerVersion, IUpdaterService updaterService) : base() + public IronyAppCast(bool isInstallerVersion, IUpdaterService updaterService) { appCast = new XMLAppCast(); IsInstallerVersion = isInstallerVersion; @@ -83,16 +84,16 @@ public IronyAppCast(bool isInstallerVersion, IUpdaterService updaterService) : b /// Gets a value indicating whether this instance is installer version. /// /// true if this instance is installer version; otherwise, false. - public bool IsInstallerVersion { get; private set; } + public bool IsInstallerVersion { get; } #endregion Properties #region Methods /// - /// Downloads the and parse. + /// Downloads and parse cast file. /// - /// true if XXXX, false otherwise. + /// true if downloaded and parsed, false otherwise. public bool DownloadAndParse() { return appCast.DownloadAndParse(); @@ -104,17 +105,18 @@ public bool DownloadAndParse() /// List<AppCastItem>. public List GetAvailableUpdates() { - Version installed = new Version(config.InstalledVersion); + var installed = new Version(config.InstalledVersion); var signatureNeeded = Utilities.IsSignatureNeeded(signatureVerifier.SecurityMode, signatureVerifier.HasValidKeyInformation(), false); var allowAlphaVersions = updaterService.Get().CheckForPrerelease; - var results = appCast.Items.Where((item) => + var results = appCast.Items.Where(item => { // Filter out prerelease tags if specified as such if (!allowAlphaVersions && prereleaseVersionTags.Any(p => item.Title.Contains(p, StringComparison.OrdinalIgnoreCase))) { return false; } + // Filter out by os if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { @@ -124,14 +126,13 @@ public List GetAvailableUpdates() { return false; } - else if (IsInstallerVersion && !fileName.Contains("setup", StringComparison.OrdinalIgnoreCase)) - { - return false; - } - else if (!IsInstallerVersion && fileName.Contains("setup", StringComparison.OrdinalIgnoreCase)) - { - return false; - } + else + switch (IsInstallerVersion) + { + case true when !fileName!.Contains("setup", StringComparison.OrdinalIgnoreCase): + case false when fileName!.Contains("setup", StringComparison.OrdinalIgnoreCase): + return false; + } } else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) && !item.IsMacOSUpdate) { @@ -141,16 +142,14 @@ public List GetAvailableUpdates() { return false; } + // Base validation stuff if (new Version(item.Version).CompareTo(installed) <= 0) { return false; } - if (signatureNeeded && string.IsNullOrEmpty(item.DownloadSignature) && !string.IsNullOrEmpty(item.DownloadLink)) - { - return false; - } - return true; + + return !signatureNeeded || !string.IsNullOrEmpty(item.DownloadSignature) || string.IsNullOrEmpty(item.DownloadLink); }).ToList(); return results; } diff --git a/src/IronyModManager/IronyModManager.csproj b/src/IronyModManager/IronyModManager.csproj index d275ef9b7..cdd1eec62 100644 --- a/src/IronyModManager/IronyModManager.csproj +++ b/src/IronyModManager/IronyModManager.csproj @@ -25,7 +25,7 @@ Debug;Release;osx-x64;linux-x64;win-x64 x64 x64 - 1701;1702;NU1603 + 1701;1702;NU1603;CS8002 True @@ -138,11 +138,11 @@ - + - + @@ -151,19 +151,18 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - + + + + + + + + diff --git a/src/IronyModManager/Log/FilePathLayout.cs b/src/IronyModManager/Log/FilePathLayout.cs deleted file mode 100644 index dd7140fd2..000000000 --- a/src/IronyModManager/Log/FilePathLayout.cs +++ /dev/null @@ -1,402 +0,0 @@ -// *********************************************************************** -// Assembly : IronyModManager -// Author : NLog -// Created : 10-29-2021 -// -// Last Modified By : Mario -// Last Modified On : 07-10-2022 -// *********************************************************************** -// -// NLog -// -// Copied only because it's internal in NLog and we need it to get the resolved directory where logs are dumped. -// *********************************************************************** - -// -// Copyright (c) 2004-2021 Jaroslaw Kowalski , Kim Christensen, Julian Verdurmen -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * Neither the name of Jaroslaw Kowalski nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -// THE POSSIBILITY OF SUCH DAMAGE. -// - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using NLog; -using NLog.Layouts; -using NLog.Targets; - -namespace IronyModManager.Log -{ - /// - /// Class FilePathLayout. - /// - public class FilePathLayout - { - #region Fields - - /// - /// Cached directory separator char array to avoid memory allocation on each method call. - /// - private static readonly char[] DirectorySeparatorChars = new[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; - - /// - /// Cached invalid file names char array to avoid memory allocation every time Path.GetInvalidFileNameChars() is called. - /// - private static readonly HashSet InvalidFileNameChars = new(Path.GetInvalidFileNameChars()); - - /// - /// not null when == false - /// - private readonly string baseDir; - - /// - /// non null is fixed, - /// - private readonly string cleanedFixedResult; - - /// - /// The cleanup invalid chars - /// - private readonly bool cleanupInvalidChars; - - /// - /// The file path kind - /// - private readonly FilePathKind filePathKind; - - /// - /// The layout - /// - private readonly Layout layout; - - /// - /// is the cache-value that is reused, when the newly rendered filename - /// matches the cache-key - /// - private string cachedPrevCleanFileName; - - /// - /// is the cache-key, and when newly rendered filename matches the cache-key, - /// then it reuses the cleaned cache-value . - /// - private string cachedPrevRawFileName; - - #endregion Fields - - #region Constructors - - /// - /// Initializes a new instance of the class. - /// - /// The layout. - /// if set to true [cleanup invalid chars]. - /// Kind of the file path. - public FilePathLayout(Layout layout, bool cleanupInvalidChars, FilePathKind filePathKind) - { - this.layout = layout; - this.filePathKind = filePathKind; - this.cleanupInvalidChars = cleanupInvalidChars; - - if (this.layout is null) - { - this.filePathKind = FilePathKind.Unknown; - return; - } - - //do we have to the layout? - if (cleanupInvalidChars || this.filePathKind == FilePathKind.Unknown) - { - cleanedFixedResult = CreateCleanedFixedResult(cleanupInvalidChars, layout); - this.filePathKind = DetectKind(layout, this.filePathKind); - } - - if (this.filePathKind == FilePathKind.Relative) - { - baseDir = AppDomain.CurrentDomain.BaseDirectory; - } - } - - #endregion Constructors - - #region Methods - - /// - /// Renders the specified log event. - /// - /// The log event. - /// System.String. - public string Render(LogEventInfo logEvent) - { - var rawFileName = GetRenderedFileName(logEvent); - if (string.IsNullOrEmpty(rawFileName)) - { - return rawFileName; - } - - if ((!cleanupInvalidChars || cleanedFixedResult != null) && filePathKind == FilePathKind.Absolute) - return rawFileName; // Skip clean filename string-allocation - - if (string.Equals(cachedPrevRawFileName, rawFileName, StringComparison.Ordinal) && cachedPrevCleanFileName != null) - return cachedPrevCleanFileName; // Cache Hit, reuse clean filename string-allocation - - var cleanFileName = GetCleanFileName(rawFileName); - cachedPrevCleanFileName = cleanFileName; - cachedPrevRawFileName = rawFileName; - return cleanFileName; - } - - /// - /// Cleanups the invalid file path. - /// - /// The file path. - /// System.String. - private static string CleanupInvalidFilePath(string filePath) - { - if (string.IsNullOrWhiteSpace(filePath)) - { - return filePath; - } - - var lastDirSeparator = filePath.LastIndexOfAny(DirectorySeparatorChars); - - char[] fileNameChars = null; - - for (int i = lastDirSeparator + 1; i < filePath.Length; i++) - { - if (InvalidFileNameChars.Contains(filePath[i])) - { - //delay char[] creation until first invalid char - //is found to avoid memory allocation. - if (fileNameChars is null) - { - fileNameChars = filePath[(lastDirSeparator + 1)..].ToCharArray(); - } - fileNameChars[i - (lastDirSeparator + 1)] = '_'; - } - } - - //only if an invalid char was replaced do we create a new string. - if (fileNameChars != null) - { - //keep the / in the dirname, because dirname could be c:/ and combine of c: and file name won't work well. -#pragma warning disable IDE0057 // Use range operator - var dirName = lastDirSeparator > 0 ? filePath.Substring(0, lastDirSeparator + 1) : string.Empty; -#pragma warning restore IDE0057 // Use range operator - string fileName = new string(fileNameChars); - return Path.Combine(dirName, fileName); - } - - return filePath; - } - - /// - /// Creates the cleaned fixed result. - /// - /// if set to true [cleanup invalid chars]. - /// The layout. - /// System.String. - private static string CreateCleanedFixedResult(bool cleanupInvalidChars, Layout layout) - { - if (layout is SimpleLayout simpleLayout) - { - var isFixedText = simpleLayout.IsFixedText; - if (isFixedText) - { - var cleanedFixedResult = simpleLayout.FixedText; - if (cleanupInvalidChars) - { - //clean first - cleanedFixedResult = CleanupInvalidFilePath(cleanedFixedResult); - } - - return cleanedFixedResult; - } - } - - return null; - } - - /// - /// Detects the kind of the file path. - /// - /// The path. - /// if set to true [is fixed text]. - /// FilePathKind. - private static FilePathKind DetectFilePathKind(string path, bool isFixedText = true) - { - if (!string.IsNullOrEmpty(path)) - { - path = path.TrimStart(); - - int length = path.Length; - if (length >= 1) - { - var firstChar = path[0]; - if (IsAbsoluteStartChar(firstChar)) - return FilePathKind.Absolute; - - if (firstChar == '.') //. and .. - { - return FilePathKind.Relative; - } - - if (length >= 2) - { - var secondChar = path[1]; - //on unix VolumeSeparatorChar == DirectorySeparatorChar - if (Path.VolumeSeparatorChar != Path.DirectorySeparatorChar && secondChar == Path.VolumeSeparatorChar) - return FilePathKind.Absolute; - } - - if (IsLayoutRenderer(path, isFixedText)) - { - //if first part is a layout, then unknown - return FilePathKind.Unknown; - } - - //not a layout renderer, but text - return FilePathKind.Relative; - } - } - return FilePathKind.Unknown; - } - - /// - /// Is this (templated/invalid) path an absolute, relative or unknown? - /// - /// The path layout. - /// FilePathKind. - private static FilePathKind DetectFilePathKind(SimpleLayout pathLayout) - { - var isFixedText = pathLayout.IsFixedText; - - //nb: ${basedir} has already been rewritten in the SimpleLayout.compile - var path = isFixedText ? pathLayout.FixedText : pathLayout.Text; - return DetectFilePathKind(path, isFixedText); - } - - /// - /// Detects the kind. - /// - /// The layout. - /// Kind of the current file path. - /// FilePathKind. - private static FilePathKind DetectKind(Layout layout, FilePathKind currentFilePathKind) - { - if (layout is SimpleLayout simpleLayout) - { - //detect absolute - if (currentFilePathKind == FilePathKind.Unknown) - { - return DetectFilePathKind(simpleLayout); - } - } - else - { - return FilePathKind.Unknown; - } - - return currentFilePathKind; - } - - /// - /// Determines whether [is absolute start character] [the specified first character]. - /// - /// The first character. - /// true if [is absolute start character] [the specified first character]; otherwise, false. - private static bool IsAbsoluteStartChar(char firstChar) - { - return firstChar == Path.DirectorySeparatorChar || firstChar == Path.AltDirectorySeparatorChar; - } - - /// - /// Determines whether [is layout renderer] [the specified path]. - /// - /// The path. - /// if set to true [is fixed text]. - /// true if [is layout renderer] [the specified path]; otherwise, false. - private static bool IsLayoutRenderer(string path, bool isFixedText) - { - return !isFixedText && path.StartsWith("${", StringComparison.OrdinalIgnoreCase); - } - - /// - /// Convert the raw filename to a correct filename - /// - /// The filename generated by Layout. - /// String representation of a correct filename. - private string GetCleanFileName(string rawFileName) - { - var cleanFileName = rawFileName; - if (cleanupInvalidChars && cleanedFixedResult is null) - { - cleanFileName = CleanupInvalidFilePath(rawFileName); - } - - if (filePathKind == FilePathKind.Absolute) - { - return cleanFileName; - } - - if (filePathKind == FilePathKind.Relative && baseDir != null) - { - //use basedir, faster than Path.GetFullPath - cleanFileName = Path.Combine(baseDir, cleanFileName); - return cleanFileName; - } - //unknown, use slow method - cleanFileName = Path.GetFullPath(cleanFileName); - return cleanFileName; - } - - /// - /// Render the raw filename from Layout - /// - /// The log event. - /// String representation of a layout. - private string GetRenderedFileName(LogEventInfo logEvent) - { - if (cleanedFixedResult != null) - { - return cleanedFixedResult; - } - - if (layout == null) - { - return null; - } - - return layout.Render(logEvent); - } - - #endregion Methods - } -} diff --git a/src/IronyModManager/Log/IronyFileTarget.cs b/src/IronyModManager/Log/IronyFileTarget.cs index 1d71aa26b..a271acc34 100644 --- a/src/IronyModManager/Log/IronyFileTarget.cs +++ b/src/IronyModManager/Log/IronyFileTarget.cs @@ -4,13 +4,14 @@ // Created : 10-29-2021 // // Last Modified By : Mario -// Last Modified On : 07-10-2022 +// Last Modified On : 12-08-2025 // *********************************************************************** // // Mario // // // *********************************************************************** + using System; using System.Collections.Generic; using System.IO; @@ -59,6 +60,7 @@ public string GetLastFatalException() DiskOperations.DeleteFile(fileName); return data; } + return string.Empty; } @@ -81,10 +83,10 @@ protected string GetOutputDirectory(LogEventInfo logEvent) { if (string.IsNullOrWhiteSpace(outputDirectory)) { - var layout = new FilePathLayout(FileName, CleanupFileName, FileNameKind); - var logFileName = layout.Render(logEvent); - outputDirectory = Path.GetDirectoryName(logFileName); + var fileName = FileName.Render(logEvent); + outputDirectory = Path.GetDirectoryName(fileName); } + return outputDirectory; } @@ -114,6 +116,7 @@ protected void LogLastFatalError(LogEventInfo logEvent) /// parameter. /// /// The logging event. + /// protected override void Write(LogEventInfo logEvent) { base.Write(logEvent); diff --git a/src/IronyModManager/Program.cs b/src/IronyModManager/Program.cs index ffbc9cc57..cbe2e7994 100644 --- a/src/IronyModManager/Program.cs +++ b/src/IronyModManager/Program.cs @@ -4,7 +4,7 @@ // Created : 01-10-2020 // // Last Modified By : Mario -// Last Modified On : 12-05-2025 +// Last Modified On : 12-08-2025 // *********************************************************************** // // Copyright (c) Mario. All rights reserved. @@ -238,7 +238,7 @@ private static void InitLogging() { LogManager.Setup().SetupExtensions(s => s.RegisterTarget("IronyFile", typeof(Log.IronyFileTarget))); var logConfig = LogManager.Configuration; - logConfig.Variables["storageRoot"] = IO.Common.DiskOperations.ResolveStoragePath(); + logConfig!.Variables["storageRoot"] = IO.Common.DiskOperations.ResolveStoragePath(); LogManager.ReconfigExistingLoggers(); } diff --git a/src/IronyModManager/appSettings.json b/src/IronyModManager/appSettings.json index 9f84e67d9..3fca6cea3 100644 --- a/src/IronyModManager/appSettings.json +++ b/src/IronyModManager/appSettings.json @@ -40,10 +40,10 @@ "UseSubMenus": true, "UseHybridMemory": true, "UseDiskSearch": true, - "CompressIndexedDefinitions": false + "CompressIndexedDefinitions": true }, "App": { "SingleInstance": true, - "StoragePath": "." + "StoragePath": "Mario" } } \ No newline at end of file diff --git a/src/IronyModManager/appSettings.osx-x64.json b/src/IronyModManager/appSettings.osx-x64.json index 58c2cdaee..740390a21 100644 --- a/src/IronyModManager/appSettings.osx-x64.json +++ b/src/IronyModManager/appSettings.osx-x64.json @@ -22,7 +22,7 @@ "App": { "@jdt.replace": { "@jdt.path": "$.StoragePath", - "@jdt.value": "." + "@jdt.value": "Mario" } } } diff --git a/src/IronyModManager/nlog.config b/src/IronyModManager/nlog.config index 87f8d2596..521650c6b 100644 --- a/src/IronyModManager/nlog.config +++ b/src/IronyModManager/nlog.config @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - + diff --git a/src/IronyModManager/nlog.win-x64.config b/src/IronyModManager/nlog.win-x64.config index 3dbe5e104..1941d1e93 100644 --- a/src/IronyModManager/nlog.win-x64.config +++ b/src/IronyModManager/nlog.win-x64.config @@ -3,8 +3,7 @@ - - + diff --git a/version.json b/version.json index faeb57ee3..6f32049c2 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json", - "version": "1.26", + "version": "1.27-alpha", "publicReleaseRefSpec": [ "^refs/heads/master$", "^refs/heads/v\\d+(?:\\.\\d+)?$",