diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index 54ac53a2..00000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM mcr.microsoft.com/vscode/devcontainers/dotnet:6.0-jammy - -# Install Mono (for DocFX) -RUN apt install -y apt-transport-https dirmngr gnupg ca-certificates \ - && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \ - && echo "deb https://download.mono-project.com/repo/ubuntu stable-focal main" >> /etc/apt/sources.list.d/mono-official-stable.list \ - && apt update \ - && apt install -y mono-devel - -# Bug in the installation of .NET 6 in ubuntu https://github.com/dotnet/runtime/issues/79237 -ENV DOTNET_ROOT=/usr/share/dotnet \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index 50050bac..00000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "Dev (.NET 6 and Mono)", - "build": { - "dockerfile": "Dockerfile", - }, - - "customizations": { - "vscode": { - "extensions": [ - "ms-dotnettools.csharp", - "shardulm94.trailing-spaces", - "cake-build.cake-vscode", - "streetsidesoftware.code-spell-checker", - "hediet.vscode-drawio", - "esbenp.prettier-vscode", - "yzhang.markdown-all-in-one", - "davidanson.vscode-markdownlint", - "eamodio.gitlens", - "GitHub.vscode-pull-request-github" - ] - } - }, - - "remoteUser": "vscode", - - // PODMAN ONLY. You may need to remove this line for Docker. - // SELinux issues: https://github.com/containers/podman/issues/3683 - "runArgs": [ "--security-opt", "label=disable", "--userns=keep-id" ], - - // Podman issues: https://github.com/microsoft/vscode-remote-release/issues/3231 - "containerEnv": { - "HOME": "/home/vscode" - } -} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index d2b4f353..59935dcb 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -9,7 +9,7 @@ "type": "coreclr", "request": "launch", "preLaunchTask": "Build release", - "program": "${workspaceFolder}/src/Yarhl.PerformanceTests/bin/Release/net6.0/Yarhl.PerformanceTests.dll", + "program": "${workspaceFolder}/src/Yarhl.PerformanceTests/bin/Release/net8.0/Yarhl.PerformanceTests.dll", "args": [ "auto" ], "cwd": "${workspaceFolder}", "stopAtEntry": false, diff --git a/README.md b/README.md index 87ca6ffc..310e7372 100644 --- a/README.md +++ b/README.md @@ -110,26 +110,16 @@ Some cool projects built with _Yarhl_: ## Contributing -The repository requires to build .NET 6.0 SDK and .NET Framework 4.8 or latest -Mono (for DocFX). If you open the project with VS Code and you did install the -[VS Code Remote Containers](https://code.visualstudio.com/docs/remote/containers) -extension, you can have an already pre-configured development environment with -Docker or Podman. +The repository requires to build .NET 8.0 SDK. To build, test and generate artifacts run: ```sh -# Only required the first time -dotnet tool restore +# Build and run tests +dotnet run --project build/orchestrator -# Default target is "Default" that builds, runs tests, build doc and create the NuGets -dotnet cake -``` - -To just build and test quickly, run: - -```sh -dotnet cake --target=BuildTest +# (Optional) Create bundles (nuget, zips, docs) +dotnet run --project build/orchestrator -- --target=Bundle ``` Additionally you can use _Visual Studio_ or _JetBrains Rider_ as any other .NET @@ -137,6 +127,11 @@ project. To contribute follow the [contributing guidelines](CONTRIBUTING.md). +### How to release + +Create a new _GitHub release_ with a tag name `v{Version}` (e.g. `v2.4`) and +that's it! This triggers a pipeline that builds and deploy the project. + ## License The software is licensed under the terms of the diff --git a/build/orchestrator/PrepareIntegrationTestsTask.cs b/build/orchestrator/PrepareIntegrationTestsTask.cs index 208b6bb6..74208eba 100644 --- a/build/orchestrator/PrepareIntegrationTestsTask.cs +++ b/build/orchestrator/PrepareIntegrationTestsTask.cs @@ -12,13 +12,13 @@ public class PrepareIntegrationTestsTask : FrostingTask public override void Run(PleOpsBuildContext context) { // Copy a good and bad plugin to test the assembly load logic - string pluginPath = $"src/Yarhl.Media.Text/bin/{context.DotNetContext.Configuration}/net6.0/Yarhl.Media.Text.dll"; string badPluginPath = context.DotNetContext.SolutionPath; // this isn't a DLL for sure :D string outputBasePath = $"src/Yarhl.IntegrationTests/bin/{context.DotNetContext.Configuration}"; string testProjectPath = "src/Yarhl.IntegrationTests/Yarhl.IntegrationTests.csproj"; foreach (string framework in GetTargetFrameworks(testProjectPath)) { + string pluginPath = $"src/Yarhl.Media.Text/bin/{context.DotNetContext.Configuration}/{framework}/Yarhl.Media.Text.dll"; string pluginDir = $"{outputBasePath}/{framework}/Plugins"; _ = Directory.CreateDirectory(pluginDir); File.Copy(pluginPath, $"{pluginDir}/Yarhl.Media.Text.dll", true); diff --git a/docs/index.md b/docs/index.md index 8c982160..8d57aadb 100644 --- a/docs/index.md +++ b/docs/index.md @@ -15,7 +15,7 @@ formats** It empowers you with... ## Usage The project has the following .NET libraries (NuGet packages via nuget.org). The -libraries only support the latest .NET LTS version: **.NET 6.0**. +libraries only support .NET LTS versions: **.NET 6.0** and **.NET 8.0**. - [![Yarhl](https://img.shields.io/nuget/v/Yarhl?label=Yarhl&logo=nuget)](https://www.nuget.org/packages/Yarhl) - `Yarhl.FileFormat`: format conversion APIs. diff --git a/src/Yarhl.Examples/Yarhl.Examples.csproj b/src/Yarhl.Examples/Yarhl.Examples.csproj index c014aebf..27c3761b 100644 --- a/src/Yarhl.Examples/Yarhl.Examples.csproj +++ b/src/Yarhl.Examples/Yarhl.Examples.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net8.0 enable false diff --git a/src/Yarhl.IntegrationTests/Yarhl.IntegrationTests.csproj b/src/Yarhl.IntegrationTests/Yarhl.IntegrationTests.csproj index f3417fa5..e00ea5e8 100644 --- a/src/Yarhl.IntegrationTests/Yarhl.IntegrationTests.csproj +++ b/src/Yarhl.IntegrationTests/Yarhl.IntegrationTests.csproj @@ -3,7 +3,7 @@ Plugin integration tests for Yarhl. - net6.0 + net6.0;net8.0 diff --git a/src/Yarhl.Media.Text/Yarhl.Media.Text.csproj b/src/Yarhl.Media.Text/Yarhl.Media.Text.csproj index 9132e5c2..1b74158f 100644 --- a/src/Yarhl.Media.Text/Yarhl.Media.Text.csproj +++ b/src/Yarhl.Media.Text/Yarhl.Media.Text.csproj @@ -5,7 +5,7 @@ Library with Yarhl converters for text formats. true - net6.0 + net6.0;net8.0 enable diff --git a/src/Yarhl.PerformanceTests/Yarhl.PerformanceTests.csproj b/src/Yarhl.PerformanceTests/Yarhl.PerformanceTests.csproj index f3798a89..dc60e79b 100644 --- a/src/Yarhl.PerformanceTests/Yarhl.PerformanceTests.csproj +++ b/src/Yarhl.PerformanceTests/Yarhl.PerformanceTests.csproj @@ -4,7 +4,7 @@ Exe Performance tests for Yarhl. - net6.0 + net8.0 false diff --git a/src/Yarhl.Plugins/Yarhl.Plugins.csproj b/src/Yarhl.Plugins/Yarhl.Plugins.csproj index 1d30aa68..c8d8727d 100644 --- a/src/Yarhl.Plugins/Yarhl.Plugins.csproj +++ b/src/Yarhl.Plugins/Yarhl.Plugins.csproj @@ -4,7 +4,7 @@ Assembly scaning for file formats and converters implemented with Yarhl. true - net6.0 + net6.0;net8.0 enable enable diff --git a/src/Yarhl.UnitTests/Yarhl.UnitTests.csproj b/src/Yarhl.UnitTests/Yarhl.UnitTests.csproj index 58cb96c9..acb1a915 100644 --- a/src/Yarhl.UnitTests/Yarhl.UnitTests.csproj +++ b/src/Yarhl.UnitTests/Yarhl.UnitTests.csproj @@ -3,7 +3,7 @@ Yarhl unit tests. - net6.0 + net6.0;net8.0 diff --git a/src/Yarhl/FileFormat/ConvertFormat.Obsolete4.cs b/src/Yarhl/FileFormat/ConvertFormat.Obsolete4.cs index 0459410d..8a7b2b8b 100644 --- a/src/Yarhl/FileFormat/ConvertFormat.Obsolete4.cs +++ b/src/Yarhl/FileFormat/ConvertFormat.Obsolete4.cs @@ -73,7 +73,10 @@ public static object With(TParam param, dynamic src) public static object With(IConverter converter, dynamic src) { ArgumentNullException.ThrowIfNull(converter); - ArgumentNullException.ThrowIfNull(src); + if (src is null) { + throw new ArgumentNullException(nameof(src)); + } + ValidateConverterType(converter.GetType(), src.GetType()); return ((dynamic)converter).Convert(src); diff --git a/src/Yarhl/Yarhl.csproj b/src/Yarhl/Yarhl.csproj index ddb00255..97e00aa3 100644 --- a/src/Yarhl/Yarhl.csproj +++ b/src/Yarhl/Yarhl.csproj @@ -5,7 +5,7 @@ Library with features for implementing file formats, converters and a virtual file system. true - net6.0 + net6.0;net8.0 enable