Skip to content

Commit 7f038b4

Browse files
authored
Merge pull request #140 from JSkimming/dotnet6-target
Added the .NET 6 build targets
2 parents 6751968 + 9b64297 commit 7f038b4

10 files changed

Lines changed: 72 additions & 79 deletions

File tree

.azure-pipelines.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,36 @@ jobs:
1010
continueOnError: "true"
1111
timeoutInMinutes: 5
1212
variables:
13-
buildFramework: net5.0
13+
buildFramework: net6.0
1414
strategy:
1515
matrix:
16-
"Linux 5.0 Debug":
17-
sdkVersion: 5.0.x
16+
"Linux 6.0 Debug":
17+
sdkVersion: 6.0.x
1818
config: Debug
1919
imageName: ubuntu-latest
2020
framework: $(buildFramework)
21-
"Linux 5.0 Release":
22-
sdkVersion: 5.0.x
21+
"Linux 6.0 Release":
22+
sdkVersion: 6.0.x
2323
config: Release
2424
imageName: ubuntu-latest
2525
framework: $(buildFramework)
26-
"MacOS 5.0 Debug":
27-
sdkVersion: 5.0.x
26+
"MacOS 6.0 Debug":
27+
sdkVersion: 6.0.x
2828
config: Debug
2929
imageName: macOS-latest
3030
framework: $(buildFramework)
31-
"MacOS 5.0 Release":
32-
sdkVersion: 5.0.x
31+
"MacOS 6.0 Release":
32+
sdkVersion: 6.0.x
3333
config: Release
3434
imageName: macOS-latest
3535
framework: $(buildFramework)
36-
"Windows 5.0 Debug":
37-
sdkVersion: 5.0.x
36+
"Windows 6.0 Debug":
37+
sdkVersion: 6.0.x
3838
config: Debug
3939
imageName: windows-latest
4040
framework: $(buildFramework)
41-
"Windows 5.0 Release":
42-
sdkVersion: 5.0.x
41+
"Windows 6.0 Release":
42+
sdkVersion: 6.0.x
4343
config: Release
4444
imageName: windows-latest
4545
framework: $(buildFramework)
@@ -70,7 +70,7 @@ jobs:
7070
codeCoverageTool: Cobertura
7171
summaryFileLocation: ./test/TestResults/output/coverage.$(framework).cobertura.xml
7272

73-
- task: BuildQualityChecks@7
73+
- task: BuildQualityChecks@8
7474
displayName: Check code coverage levels
7575
inputs:
7676
showStatistics: true

.circleci/config.yml

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ orbs:
4040
description: The .NET Core SDK image tag to use.
4141
type: string
4242
docker:
43-
- image: mcr.microsoft.com/dotnet/<<parameters.tag>>
43+
- image: mcr.microsoft.com/dotnet/sdk:<<parameters.tag>>
4444

4545
workflows:
4646

@@ -49,42 +49,22 @@ workflows:
4949
- shellcheck/check:
5050
name: shellcheck
5151
- build/run-build:
52-
name: 3.1 Debug Build
53-
image-tag: "core/sdk:3.1"
52+
name: .NET 6.0 Debug
53+
image-tag: "6.0"
5454
build-config: Debug
55-
framework: netcoreapp3.1
55+
framework: net6.0
5656
- build/run-build:
57-
name: 3.1 Alpine Debug Build
58-
image-tag: "core/sdk:3.1-alpine"
57+
name: Alpine .NET 6.0 Debug
58+
image-tag: "6.0-alpine"
5959
build-config: Debug
60-
framework: netcoreapp3.1
60+
framework: net6.0
6161
- build/run-build:
62-
name: 3.1 Release Build
63-
image-tag: "core/sdk:3.1"
62+
name: .NET 6.0 Release
63+
image-tag: "6.0"
6464
build-config: Release
65-
framework: netcoreapp3.1
65+
framework: net6.0
6666
- build/run-build:
67-
name: 3.1 Alpine Release Build
68-
image-tag: "core/sdk:3.1-alpine"
67+
name: Alpine .NET 6.0 Release
68+
image-tag: "6.0-alpine"
6969
build-config: Release
70-
framework: netcoreapp3.1
71-
- build/run-build:
72-
name: 5.0 Debug Build
73-
image-tag: "sdk:5.0"
74-
build-config: Debug
75-
framework: net5.0
76-
- build/run-build:
77-
name: 5.0 Alpine Debug Build
78-
image-tag: "sdk:5.0-alpine"
79-
build-config: Debug
80-
framework: net5.0
81-
- build/run-build:
82-
name: 5.0 Release Build
83-
image-tag: "sdk:5.0"
84-
build-config: Release
85-
framework: net5.0
86-
- build/run-build:
87-
name: 5.0 Alpine Release Build
88-
image-tag: "sdk:5.0-alpine"
89-
build-config: Release
90-
framework: net5.0
70+
framework: net6.0

.github/workflows/ci.yaml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,18 @@ jobs:
2323
- Debug
2424
- Release
2525
framework:
26-
- netcoreapp3.1
27-
- net5.0
26+
- net6.0
2827
name: Test ${{ matrix.os }} ${{ matrix.framework }} ${{ matrix.config }}
2928

3029
steps:
3130

3231
- uses: actions/checkout@v2
3332

34-
- name: Setup .NET Core 3.1
33+
- name: Setup .NET 6.0
3534
uses: actions/setup-dotnet@v1
36-
if: matrix.framework == 'netcoreapp3.1'
35+
if: matrix.framework == 'net6.0'
3736
with:
38-
dotnet-version: 3.1.x
39-
40-
- name: Setup .NET 5.0
41-
uses: actions/setup-dotnet@v1
42-
if: matrix.framework == 'net5.0'
43-
with:
44-
dotnet-version: 5.0.x
37+
dotnet-version: 6.0.x
4538

4639
- name: Test Coverage
4740
run: ./coverage.sh ${{ matrix.framework }} ${{ matrix.config }}
@@ -52,16 +45,16 @@ jobs:
5245
strategy:
5346
matrix:
5447
framework:
55-
- net5.0
48+
- net6.0
5649

5750
steps:
5851

5952
- uses: actions/checkout@v2
6053

61-
- name: Setup .NET 5.0
54+
- name: Setup .NET 6.0
6255
uses: actions/setup-dotnet@v1
6356
with:
64-
dotnet-version: 5.0.x
57+
dotnet-version: 6.0.x
6558

6659
- name: Test Coverage
6760
run: ./coverage.sh ${{ matrix.framework }} Release

Dockerfile

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# shellcheck - lining for bash scrips
33
FROM koalaman/shellcheck-alpine:stable
44

5-
COPY ./ ./
5+
COPY . .
66

77
# Run shell check on all the shell files.
8-
RUN find . -type f -name '*.sh' | wc -l && find . -type f -name '*.sh' | xargs shellcheck --external-sources
8+
RUN find . -type f -name '*.sh' | wc -l find . -type f -name '*.sh' | xargs shellcheck --external-sources --color=always
99

1010
########################################################################################################################
1111
# .NET Core 3.1
@@ -42,3 +42,21 @@ RUN dotnet restore
4242
COPY . .
4343

4444
RUN ./coverage.sh net5.0 Debug
45+
46+
########################################################################################################################
47+
# .NET 6
48+
FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine
49+
50+
WORKDIR /work
51+
52+
# Copy just the solution and proj files to make best use of docker image caching.
53+
COPY ./castle.core.asyncinterceptor.sln .
54+
COPY ./src/Castle.Core.AsyncInterceptor/Castle.Core.AsyncInterceptor.csproj ./src/Castle.Core.AsyncInterceptor/Castle.Core.AsyncInterceptor.csproj
55+
COPY ./test/Castle.Core.AsyncInterceptor.Tests/Castle.Core.AsyncInterceptor.Tests.csproj ./test/Castle.Core.AsyncInterceptor.Tests/Castle.Core.AsyncInterceptor.Tests.csproj
56+
57+
# Run restore on just the project files, this should cache the image after restore.
58+
RUN dotnet restore
59+
60+
COPY . .
61+
62+
RUN ./coverage.sh net6.0 Debug

castle.core.asyncinterceptor.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.26403.3
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.32014.148
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F820D2E2-6C9C-4165-9C13-C77B2737A5AC}"
77
EndProject

coverage.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
exe() { echo; echo "\$ $*" ; "$@" ; }
55

66
# Parameters
7-
framework="${1-netcoreapp3.1}"
7+
framework="${1-net6.0}"
88
config="${2-Debug}"
99

1010
include="[Castle.Core.AsyncInterceptor]*"

src/Castle.Core.AsyncInterceptor/AsyncInterceptorBase.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace Castle.DynamicProxy
2020
Justification = "Must propagate the same exceptions.")]
2121
public abstract class AsyncInterceptorBase : IAsyncInterceptor
2222
{
23-
#if !NETSTANDARD2_0 && !NET5_0
23+
#if NET45
2424
/// <summary>
2525
/// A completed <see cref="Task"/>.
2626
/// </summary>
@@ -138,20 +138,20 @@ private static Task ProceedSynchronous(IInvocation invocation, IInvocationProcee
138138
try
139139
{
140140
proceedInfo.Invoke();
141-
#if NETSTANDARD2_0 || NET5_0
142-
return Task.CompletedTask;
143-
#else
141+
#if NET45
144142
return CompletedTask;
143+
#else
144+
return Task.CompletedTask;
145145
#endif
146146
}
147147
catch (Exception e)
148148
{
149-
#if NETSTANDARD2_0 || NET5_0
150-
return Task.FromException(e);
151-
#else
149+
#if NET45
152150
var tcs = new TaskCompletionSource<int>();
153151
tcs.SetException(e);
154152
return tcs.Task;
153+
#else
154+
return Task.FromException(e);
155155
#endif
156156
}
157157
}
@@ -167,12 +167,12 @@ private static Task<TResult> ProceedSynchronous<TResult>(
167167
}
168168
catch (Exception e)
169169
{
170-
#if NETSTANDARD2_0 || NET5_0
171-
return Task.FromException<TResult>(e);
172-
#else
170+
#if NET45
173171
var tcs = new TaskCompletionSource<TResult>();
174172
tcs.SetException(e);
175173
return tcs.Task;
174+
#else
175+
return Task.FromException<TResult>(e);
176176
#endif
177177
}
178178
}

src/Castle.Core.AsyncInterceptor/Castle.Core.AsyncInterceptor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net45;netstandard2.0;net5.0</TargetFrameworks>
4+
<TargetFrameworks>net45;netstandard2.0;net5.0;net6.0</TargetFrameworks>
55
<RootNamespace>Castle.DynamicProxy</RootNamespace>
66
<LangVersion>latest</LangVersion>
77
<GenerateDocumentationFile>true</GenerateDocumentationFile>

src/Castle.Core.AsyncInterceptor/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
[assembly: AssemblyTitle("Castle.Core.AsyncInterceptor .NET Framework")]
1313
#elif NET5_0
1414
[assembly: AssemblyTitle("Castle.Core.AsyncInterceptor .NET 5.0")]
15+
#elif NET6_0
16+
[assembly: AssemblyTitle("Castle.Core.AsyncInterceptor .NET 6.0")]
1517
#else
1618
[assembly: AssemblyTitle("Castle.Core.AsyncInterceptor .NET Standard")]
1719
#endif

test/Castle.Core.AsyncInterceptor.Tests/Castle.Core.AsyncInterceptor.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net472;netcoreapp3.1;net5.0</TargetFrameworks>
4+
<TargetFrameworks>net472;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
55
<LangVersion>latest</LangVersion>
66
<RootNamespace>Castle.DynamicProxy</RootNamespace>
77
<IsPackable>false</IsPackable>
@@ -53,4 +53,4 @@
5353
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
5454
</ItemGroup>
5555

56-
</Project>
56+
</Project>

0 commit comments

Comments
 (0)