Skip to content

Commit 51f4f92

Browse files
authored
Merge pull request castleproject#616 from Jevonius/add-net6-targets
Add `net6.0` as a target framework
2 parents 38298f3 + 0076083 commit 51f4f92

25 files changed

+3173
-52
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ jobs:
3737

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

40-
- name: Install .NET 5.0
40+
- name: Install .NET 6.0
4141
uses: actions/setup-dotnet@v1
4242
with:
43-
dotnet-version: 5.0.x
43+
dotnet-version: 6.0.x
4444

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

65+
- name: Test on .NET 6.0
66+
run: dotnet test -c Release -f net6.0 --no-build --no-restore -l "console;verbosity=detailed"
67+
6568
- name: Test on .NET Framework 4.6.2 (Windows only)
6669
if: matrix.os == 'windows-latest'
6770
run: dotnet test -c Release -f net462 --no-build --no-restore -l "console;verbosity=detailed"

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44

55
Enhancements:
6+
- .NET 6.0 support (@Jevonius, #616)
67
- .NET Standard 2.0 and 2.1 support (@lg2de, #485)
78
- Non-intercepted methods on a class proxy with target are now forwarded to the target (@stakx, #571)
89
- 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)

Castle.Core.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Castle Services", "Castle S
3232
EndProject
3333
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}"
3434
EndProject
35+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitHub Actions", "GitHub Actions", "{149DB291-CBD6-4F82-A6A6-758E328DB946}"
36+
ProjectSection(SolutionItems) = preProject
37+
.github\workflows\build.yml = .github\workflows\build.yml
38+
EndProjectSection
39+
EndProject
3540
Global
3641
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3742
Debug|Any CPU = Debug|Any CPU
@@ -70,6 +75,7 @@ Global
7075
{AFD3B071-E971-499B-A95B-E98155EB66E8} = {A598EE9B-41CE-4BE8-BF93-2C91F919F97E}
7176
{344D907D-6641-4A61-94C2-4980B5804FE2} = {A598EE9B-41CE-4BE8-BF93-2C91F919F97E}
7277
{91B2A82F-63F6-46B1-8EDC-5D029BCF6A2B} = {A598EE9B-41CE-4BE8-BF93-2C91F919F97E}
78+
{149DB291-CBD6-4F82-A6A6-758E328DB946} = {1B999D24-B7AB-4997-96E7-08FA05325694}
7379
EndGlobalSection
7480
GlobalSection(ExtensibilityGlobals) = postSolution
7581
SolutionGuid = {682D4399-4863-4813-B495-5FEDD22496ED}

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Debugging symbols are available in symbol packages in the AppVeyor build artifac
1616

1717
## License
1818

19-
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.
19+
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.
2020

2121
## Contributing
2222

@@ -36,9 +36,9 @@ build.cmd
3636

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

39-
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>`.)
39+
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>`.)
4040

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

4343
### On Linux
4444

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

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

51-
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.
51+
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.
5252

5353
: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).
5454

@@ -66,8 +66,6 @@ Symbol | .NET 4.6.2 | .NET Standard 2.x
6666
`FEATURE_ASSEMBLYBUILDER_SAVE` | :white_check_mark: | :no_entry_sign:
6767
`FEATURE_SERIALIZATION` | :white_check_mark: | :no_entry_sign:
6868
`FEATURE_SYSTEM_CONFIGURATION` | :white_check_mark: | :no_entry_sign:
69-
--- | |
70-
`DOTNET462` | :white_check_mark: | :no_entry_sign:
7169

7270
* `FEATURE_APPDOMAIN` - enables support for features that make use of an AppDomain in the host.
7371
* `FEATURE_ASSEMBLYBUILDER_SAVE` - enabled support for saving the dynamically generated proxy assembly.

appveyor.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
image:
2-
- Visual Studio 2019
2+
- Visual Studio 2022
33
- Ubuntu
44

55

@@ -36,7 +36,7 @@ for:
3636
# -------------------
3737
matrix:
3838
only:
39-
- image: Visual Studio 2019
39+
- image: Visual Studio 2022
4040

4141
# update AppVeyor build version; this matters for deployments
4242
init:
@@ -56,6 +56,8 @@ for:
5656
$wc = New-Object System.Net.WebClient
5757
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "NetCoreClrTestResults.xml"))
5858
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "NetCoreClrWeakNamedTestResults.xml"))
59+
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "Net60TestResults.xml"))
60+
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "Net60WeakNamedTestResults.xml"))
5961
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "DesktopClrTestResults.xml"))
6062
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "DesktopClrWeakNamedTestResults.xml"))
6163

build.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
# ****************************************************************************
3-
# Copyright 2004-2021 Castle Project - http://www.castleproject.org/
3+
# Copyright 2004-2022 Castle Project - http://www.castleproject.org/
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
66
# You may obtain a copy of the License at
@@ -54,9 +54,18 @@ echo ---------------------------
5454
dotnet ./src/Castle.Core.Tests/bin/Release/netcoreapp3.1/Castle.Core.Tests.dll --result=NetCoreClrTestResults.xml;format=nunit3
5555
dotnet ./src/Castle.Core.Tests.WeakNamed/bin/Release/netcoreapp3.1/Castle.Core.Tests.WeakNamed.dll --result=NetCoreClrWeakNamedTestResults.xml;format=nunit3
5656

57+
echo ---------------------------
58+
echo Running NET6.0 Tests
59+
echo ---------------------------
60+
61+
dotnet ./src/Castle.Core.Tests/bin/Release/net6.0/Castle.Core.Tests.dll --result=Net60TestResults.xml;format=nunit3
62+
dotnet ./src/Castle.Core.Tests.WeakNamed/bin/Release/net6.0/Castle.Core.Tests.WeakNamed.dll --result=Net60WeakNamedTestResults.xml;format=nunit3
63+
5764
# Ensure that all test runs produced a protocol file:
5865
if [[ !( -f NetCoreClrTestResults.xml &&
5966
-f NetCoreClrWeakNamedTestResults.xml &&
67+
-f Net60TestResults.xml &&
68+
-f Net60WeakNamedTestResults.xml &&
6069
-f DesktopClrTestResults.xml &&
6170
-f DesktopClrWeakNamedTestResults.xml ) ]]; then
6271
echo "Incomplete test results. Some test runs might not have terminated properly. Failing the build."
@@ -71,6 +80,13 @@ then
7180
exit 1
7281
fi
7382

83+
NET60_FAILCOUNT=$(grep -F "One or more child tests had errors" Net60TestResults.xml Net60WeakNamedTestResults.xml | wc -l)
84+
if [ $NET60_FAILCOUNT -ne 0 ]
85+
then
86+
echo "Net6.0 Tests have failed, failing the build"
87+
exit 1
88+
fi
89+
7490
MONO_FAILCOUNT=$(grep -F "One or more child tests had errors" DesktopClrTestResults.xml DesktopClrWeakNamedTestResults.xml | wc -l)
7591
if [ $MONO_FAILCOUNT -ne 0 ]
7692
then

buildscripts/build.cmd

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@ECHO OFF
22
REM ****************************************************************************
3-
REM Copyright 2004-2021 Castle Project - http://www.castleproject.org/
3+
REM Copyright 2004-2022 Castle Project - http://www.castleproject.org/
44
REM Licensed under the Apache License, Version 2.0 (the "License");
55
REM you may not use this file except in compliance with the License.
66
REM You may obtain a copy of the License at
@@ -46,3 +46,11 @@ echo ---------------------------
4646

4747
dotnet .\src\Castle.Core.Tests\bin\%Configuration%\netcoreapp3.1\Castle.Core.Tests.dll --result=NetCoreClrTestResults.xml;format=nunit3 || exit /b 1
4848
dotnet .\src\Castle.Core.Tests.WeakNamed\bin\%Configuration%\netcoreapp3.1/Castle.Core.Tests.WeakNamed.dll --result=NetCoreClrWeakNamedTestResults.xml;format=nunit3 || exit /b 1
49+
50+
51+
echo ---------------------------
52+
echo Running NET6.0 Tests
53+
echo ---------------------------
54+
55+
dotnet .\src\Castle.Core.Tests\bin\%Configuration%\net6.0\Castle.Core.Tests.dll --result=Net60TestResults.xml;format=nunit3 || exit /b 1
56+
dotnet .\src\Castle.Core.Tests.WeakNamed\bin\%Configuration%\net6.0/Castle.Core.Tests.WeakNamed.dll --result=Net60WeakNamedTestResults.xml;format=nunit3 || exit /b 1

buildscripts/common.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@
5151
</PropertyGroup>
5252

5353
<PropertyGroup Condition="'$(TargetFramework)|$(Configuration)'=='net462|Debug'">
54-
<DefineConstants>$(DiagnosticsConstants);$(DesktopClrConstants);DOTNET462</DefineConstants>
54+
<DefineConstants>$(DiagnosticsConstants);$(DesktopClrConstants)</DefineConstants>
5555
</PropertyGroup>
5656

5757
<PropertyGroup Condition="'$(TargetFramework)|$(Configuration)'=='net462|Release'">
58-
<DefineConstants>$(DesktopClrConstants);DOTNET462</DefineConstants>
58+
<DefineConstants>$(DesktopClrConstants)</DefineConstants>
5959
</PropertyGroup>
6060

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

0 commit comments

Comments
 (0)