Skip to content

Commit

Permalink
Merge pull request #616 from Jevonius/add-net6-targets
Browse files Browse the repository at this point in the history
Add `net6.0` as a target framework
  • Loading branch information
jonorossi committed May 9, 2022
2 parents 38298f3 + 0076083 commit 51f4f92
Show file tree
Hide file tree
Showing 25 changed files with 3,173 additions and 52 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/build.yml
Expand Up @@ -37,10 +37,10 @@ jobs:

# Building requires an up-to-date .NET SDK.

- name: Install .NET 5.0
- name: Install .NET 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
dotnet-version: 6.0.x

# -----
# Build
Expand All @@ -62,6 +62,9 @@ jobs:
- name: Test on .NET Core 3.1
run: dotnet test -c Release -f netcoreapp3.1 --no-build --no-restore -l "console;verbosity=detailed"

- name: Test on .NET 6.0
run: dotnet test -c Release -f net6.0 --no-build --no-restore -l "console;verbosity=detailed"

- name: Test on .NET Framework 4.6.2 (Windows only)
if: matrix.os == 'windows-latest'
run: dotnet test -c Release -f net462 --no-build --no-restore -l "console;verbosity=detailed"
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,7 @@
## Unreleased

Enhancements:
- .NET 6.0 support (@Jevonius, #616)
- .NET Standard 2.0 and 2.1 support (@lg2de, #485)
- Non-intercepted methods on a class proxy with target are now forwarded to the target (@stakx, #571)
- Significant performance improvements with proxy type generation for interface proxies without target. (Up until now, DynamicProxy generated a separate `IInvocation` implementation type for every single proxied method – it is now able to reuse a single predefined type in many cases, thereby reducing the total amount of dynamic type generation.) (@stakx, #573)
Expand Down
6 changes: 6 additions & 0 deletions Castle.Core.sln
Expand Up @@ -32,6 +32,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Castle Services", "Castle S
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Castle.Core.Tests.WeakNamed", "src\Castle.Core.Tests.WeakNamed\Castle.Core.Tests.WeakNamed.csproj", "{14D86762-CF9B-4560-80C9-10C16DBE246C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitHub Actions", "GitHub Actions", "{149DB291-CBD6-4F82-A6A6-758E328DB946}"
ProjectSection(SolutionItems) = preProject
.github\workflows\build.yml = .github\workflows\build.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -70,6 +75,7 @@ Global
{AFD3B071-E971-499B-A95B-E98155EB66E8} = {A598EE9B-41CE-4BE8-BF93-2C91F919F97E}
{344D907D-6641-4A61-94C2-4980B5804FE2} = {A598EE9B-41CE-4BE8-BF93-2C91F919F97E}
{91B2A82F-63F6-46B1-8EDC-5D029BCF6A2B} = {A598EE9B-41CE-4BE8-BF93-2C91F919F97E}
{149DB291-CBD6-4F82-A6A6-758E328DB946} = {1B999D24-B7AB-4997-96E7-08FA05325694}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {682D4399-4863-4813-B495-5FEDD22496ED}
Expand Down
10 changes: 4 additions & 6 deletions README.md
Expand Up @@ -16,7 +16,7 @@ Debugging symbols are available in symbol packages in the AppVeyor build artifac

## License

Castle Core is © 2004-2021 Castle Project. It is free software, and may be redistributed under the terms of the [Apache 2.0](http://opensource.org/licenses/Apache-2.0) license.
Castle Core is © 2004-2022 Castle Project. It is free software, and may be redistributed under the terms of the [Apache 2.0](http://opensource.org/licenses/Apache-2.0) license.

## Contributing

Expand All @@ -36,9 +36,9 @@ build.cmd

Compilation requires a C# 9 compiler, an up-to-date .NET Core SDK, and MSBuild 15+ (which should be included in the former).

Running the unit tests additionally requires the .NET Framework 4.6.2+ as well as the .NET Core 2.1 and 3.1 runtimes to be installed. (If you do not have all of those installed, you can run the tests for a specific target framework using `dotnet test -f <framework>`.)
Running the unit tests additionally requires the .NET Framework 4.6.2+ as well as the .NET Core 2.1, 3.1 and 6.0 runtimes to be installed. (If you do not have all of those installed, you can run the tests for a specific target framework using `dotnet test -f <framework>`.)

These requirements should be covered by Visual Studio 2019 and the .NET 5 SDK.
These requirements should be covered by Visual Studio 2022 and the .NET 6 SDK.

### On Linux

Expand All @@ -48,7 +48,7 @@ These requirements should be covered by Visual Studio 2019 and the .NET 5 SDK.

Compilation requires an up-to-date .NET Core SDK.

Running the unit tests additionally requires the .NET Core 3.1 runtime to be installed, as well as either Docker or Mono. For the latter, we recommend Mono 5.10+, though older versions (4.6.1+) might still work as well.
Running the unit tests additionally requires the .NET Core 3.1 and 6.0 runtimes to be installed, as well as either Docker or Mono. For the latter, we recommend Mono 5.10+, though older versions (4.6.1+) might still work as well.

:information_source: **Mono runtime support:** Castle Core runs with minor limitations and defects on Mono 4.0.2+ (however 4.6.1+ is highly recommended, or 5.10+ if your code uses new C# 7.x language features such as `in` parameters).

Expand All @@ -66,8 +66,6 @@ Symbol | .NET 4.6.2 | .NET Standard 2.x
`FEATURE_ASSEMBLYBUILDER_SAVE` | :white_check_mark: | :no_entry_sign:
`FEATURE_SERIALIZATION` | :white_check_mark: | :no_entry_sign:
`FEATURE_SYSTEM_CONFIGURATION` | :white_check_mark: | :no_entry_sign:
--- | |
`DOTNET462` | :white_check_mark: | :no_entry_sign:

* `FEATURE_APPDOMAIN` - enables support for features that make use of an AppDomain in the host.
* `FEATURE_ASSEMBLYBUILDER_SAVE` - enabled support for saving the dynamically generated proxy assembly.
Expand Down
6 changes: 4 additions & 2 deletions appveyor.yml
@@ -1,5 +1,5 @@
image:
- Visual Studio 2019
- Visual Studio 2022
- Ubuntu


Expand Down Expand Up @@ -36,7 +36,7 @@ for:
# -------------------
matrix:
only:
- image: Visual Studio 2019
- image: Visual Studio 2022

# update AppVeyor build version; this matters for deployments
init:
Expand All @@ -56,6 +56,8 @@ for:
$wc = New-Object System.Net.WebClient
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "NetCoreClrTestResults.xml"))
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "NetCoreClrWeakNamedTestResults.xml"))
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "Net60TestResults.xml"))
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "Net60WeakNamedTestResults.xml"))
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "DesktopClrTestResults.xml"))
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "DesktopClrWeakNamedTestResults.xml"))
Expand Down
18 changes: 17 additions & 1 deletion build.sh
@@ -1,6 +1,6 @@
#!/bin/bash
# ****************************************************************************
# Copyright 2004-2021 Castle Project - http://www.castleproject.org/
# Copyright 2004-2022 Castle Project - http://www.castleproject.org/
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down Expand Up @@ -54,9 +54,18 @@ echo ---------------------------
dotnet ./src/Castle.Core.Tests/bin/Release/netcoreapp3.1/Castle.Core.Tests.dll --result=NetCoreClrTestResults.xml;format=nunit3
dotnet ./src/Castle.Core.Tests.WeakNamed/bin/Release/netcoreapp3.1/Castle.Core.Tests.WeakNamed.dll --result=NetCoreClrWeakNamedTestResults.xml;format=nunit3

echo ---------------------------
echo Running NET6.0 Tests
echo ---------------------------

dotnet ./src/Castle.Core.Tests/bin/Release/net6.0/Castle.Core.Tests.dll --result=Net60TestResults.xml;format=nunit3
dotnet ./src/Castle.Core.Tests.WeakNamed/bin/Release/net6.0/Castle.Core.Tests.WeakNamed.dll --result=Net60WeakNamedTestResults.xml;format=nunit3

# Ensure that all test runs produced a protocol file:
if [[ !( -f NetCoreClrTestResults.xml &&
-f NetCoreClrWeakNamedTestResults.xml &&
-f Net60TestResults.xml &&
-f Net60WeakNamedTestResults.xml &&
-f DesktopClrTestResults.xml &&
-f DesktopClrWeakNamedTestResults.xml ) ]]; then
echo "Incomplete test results. Some test runs might not have terminated properly. Failing the build."
Expand All @@ -71,6 +80,13 @@ then
exit 1
fi

NET60_FAILCOUNT=$(grep -F "One or more child tests had errors" Net60TestResults.xml Net60WeakNamedTestResults.xml | wc -l)
if [ $NET60_FAILCOUNT -ne 0 ]
then
echo "Net6.0 Tests have failed, failing the build"
exit 1
fi

MONO_FAILCOUNT=$(grep -F "One or more child tests had errors" DesktopClrTestResults.xml DesktopClrWeakNamedTestResults.xml | wc -l)
if [ $MONO_FAILCOUNT -ne 0 ]
then
Expand Down
10 changes: 9 additions & 1 deletion buildscripts/build.cmd
@@ -1,6 +1,6 @@
@ECHO OFF
REM ****************************************************************************
REM Copyright 2004-2021 Castle Project - http://www.castleproject.org/
REM Copyright 2004-2022 Castle Project - http://www.castleproject.org/
REM Licensed under the Apache License, Version 2.0 (the "License");
REM you may not use this file except in compliance with the License.
REM You may obtain a copy of the License at
Expand Down Expand Up @@ -46,3 +46,11 @@ echo ---------------------------

dotnet .\src\Castle.Core.Tests\bin\%Configuration%\netcoreapp3.1\Castle.Core.Tests.dll --result=NetCoreClrTestResults.xml;format=nunit3 || exit /b 1
dotnet .\src\Castle.Core.Tests.WeakNamed\bin\%Configuration%\netcoreapp3.1/Castle.Core.Tests.WeakNamed.dll --result=NetCoreClrWeakNamedTestResults.xml;format=nunit3 || exit /b 1


echo ---------------------------
echo Running NET6.0 Tests
echo ---------------------------

dotnet .\src\Castle.Core.Tests\bin\%Configuration%\net6.0\Castle.Core.Tests.dll --result=Net60TestResults.xml;format=nunit3 || exit /b 1
dotnet .\src\Castle.Core.Tests.WeakNamed\bin\%Configuration%\net6.0/Castle.Core.Tests.WeakNamed.dll --result=Net60WeakNamedTestResults.xml;format=nunit3 || exit /b 1
4 changes: 2 additions & 2 deletions buildscripts/common.props
Expand Up @@ -51,11 +51,11 @@
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)|$(Configuration)'=='net462|Debug'">
<DefineConstants>$(DiagnosticsConstants);$(DesktopClrConstants);DOTNET462</DefineConstants>
<DefineConstants>$(DiagnosticsConstants);$(DesktopClrConstants)</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)|$(Configuration)'=='net462|Release'">
<DefineConstants>$(DesktopClrConstants);DOTNET462</DefineConstants>
<DefineConstants>$(DesktopClrConstants)</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)|$(Configuration)'=='netstandard2.0|Debug'">
Expand Down

0 comments on commit 51f4f92

Please sign in to comment.