Skip to content

Commit

Permalink
Merge pull request #198 from SceneGate/feature/net8
Browse files Browse the repository at this point in the history
✨ Support .NET 8.0
  • Loading branch information
pleonex authored Nov 23, 2023
2 parents 47db290 + 0d613ff commit 8283cd2
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 71 deletions.
11 changes: 0 additions & 11 deletions .devcontainer/Dockerfile

This file was deleted.

34 changes: 0 additions & 34 deletions .devcontainer/devcontainer.json

This file was deleted.

2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
25 changes: 10 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,33 +110,28 @@ 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
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
Expand Down
2 changes: 1 addition & 1 deletion build/orchestrator/PrepareIntegrationTestsTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ public class PrepareIntegrationTestsTask : FrostingTask<PleOpsBuildContext>
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);
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/Yarhl.Examples/Yarhl.Examples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>

<GenerateDocumentationFile>false</GenerateDocumentationFile>
Expand Down
2 changes: 1 addition & 1 deletion src/Yarhl.IntegrationTests/Yarhl.IntegrationTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<PropertyGroup>
<Description>Plugin integration tests for Yarhl.</Description>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Yarhl.Media.Text/Yarhl.Media.Text.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Description>Library with Yarhl converters for text formats.</Description>
<IsPackable>true</IsPackable>

<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>

<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Yarhl.PerformanceTests/Yarhl.PerformanceTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<Description>Performance tests for Yarhl.</Description>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>

<GenerateDocumentationFile>false</GenerateDocumentationFile>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Yarhl.Plugins/Yarhl.Plugins.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description>Assembly scaning for file formats and converters implemented with Yarhl.</Description>
<IsPackable>true</IsPackable>

<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>

<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand Down
2 changes: 1 addition & 1 deletion src/Yarhl.UnitTests/Yarhl.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<PropertyGroup>
<Description>Yarhl unit tests.</Description>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
5 changes: 4 additions & 1 deletion src/Yarhl/FileFormat/ConvertFormat.Obsolete4.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ public static object With<TConv, TParam>(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);
Expand Down
2 changes: 1 addition & 1 deletion src/Yarhl/Yarhl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Description>Library with features for implementing file formats, converters and a virtual file system.</Description>
<IsPackable>true</IsPackable>

<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>

<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down

0 comments on commit 8283cd2

Please sign in to comment.