Skip to content

Commit 3bd611d

Browse files
authored
feat(cli): update csharp & fsharp template to net6.0 (#23926)
Update the csharp & fsharp templates to net6.0 NET Core 3.1 is EOL, see https://endoflife.date/dotnet Closes #23921. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 4e81599 commit 3bd611d

File tree

12 files changed

+19
-15
lines changed

12 files changed

+19
-15
lines changed

Diff for: CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ The following tools need to be installed on your system prior to installing the
6060
- [Node.js >= 14.15.0](https://nodejs.org/download/release/latest-v14.x/)
6161
- We recommend using a version in [Active LTS](https://nodejs.org/en/about/releases/)
6262
- [Yarn >= 1.19.1, < 2](https://yarnpkg.com/lang/en/docs/install)
63-
- [.NET Core SDK >= 3.1.x](https://www.microsoft.com/net/download)
63+
- [.NET SDK >= 6.0.x](https://www.microsoft.com/net/download)
6464
- [Python >= 3.6.5, < 4.0](https://www.python.org/downloads/release/python-365/)
6565
- [Docker >= 19.03](https://docs.docker.com/get-docker/)
6666
- the Docker daemon must also be running

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The CDK is available in the following languages:
2525
- We recommend using a version in [Active LTS](https://nodejs.org/en/about/releases/)
2626
* Python ([Python ≥ 3.6](https://www.python.org/downloads/))
2727
* Java ([Java ≥ 8](https://www.oracle.com/technetwork/java/javase/downloads/index.html) and [Maven ≥ 3.5.4](https://maven.apache.org/download.cgi))
28-
* .NET ([.NET Core ≥ 3.1](https://dotnet.microsoft.com/download))
28+
* .NET ([.NET ≥ 6.0](https://dotnet.microsoft.com/download))
2929
* Go ([Go ≥ 1.16.4](https://golang.org/))
3030

3131
Third-party Language Deprecation: language version is only supported until its EOL (End Of Life) shared by the vendor or community and is subject to change with prior notice.

Diff for: packages/aws-cdk/lib/init-templates/app/csharp/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This is a blank project for CDK development with C#.
44

55
The `cdk.json` file tells the CDK Toolkit how to execute your app.
66

7-
It uses the [.NET Core CLI](https://docs.microsoft.com/dotnet/articles/core/) to compile and execute your project.
7+
It uses the [.NET CLI](https://docs.microsoft.com/dotnet/articles/core/) to compile and execute your project.
88

99
## Useful commands
1010

Diff for: packages/aws-cdk/lib/init-templates/app/csharp/src/%name.PascalCased%/%name.PascalCased%.template.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFramework>net6.0</TargetFramework>
66
<!-- Roll forward to future major versions of the netcoreapp as needed -->
77
<RollForward>Major</RollForward>
88
</PropertyGroup>

Diff for: packages/aws-cdk/lib/init-templates/app/fsharp/src/%name.PascalCased%/%name.PascalCased%.template.fsproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFramework>net6.0</TargetFramework>
66
<!-- Roll forward to future major versions of the netcoreapp as needed -->
77
<RollForward>Major</RollForward>
88
</PropertyGroup>

Diff for: packages/aws-cdk/lib/init-templates/sample-app/csharp/README.template.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ which contains an Amazon SQS queue that is subscribed to an Amazon SNS topic.
55

66
The `cdk.json` file tells the CDK Toolkit how to execute your app.
77

8-
It uses the [.NET Core CLI](https://docs.microsoft.com/dotnet/articles/core/) to compile and execute your project.
8+
It uses the [.NET CLI](https://docs.microsoft.com/dotnet/articles/core/) to compile and execute your project.
99

1010
## Useful commands
1111

Diff for: packages/aws-cdk/lib/init-templates/sample-app/csharp/src/%name.PascalCased%/%name.PascalCased%.template.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFramework>net6.0</TargetFramework>
66
<!-- Roll forward to future major versions of the netcoreapp as needed -->
77
<RollForward>Major</RollForward>
88
</PropertyGroup>

Diff for: packages/aws-cdk/lib/init-templates/sample-app/fsharp/README.template.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ which contains an Amazon SQS queue that is subscribed to an Amazon SNS topic.
66

77
The `cdk.json` file tells the CDK Toolkit how to execute your app.
88

9-
It uses the [.NET Core CLI](https://docs.microsoft.com/dotnet/articles/core/) to compile and execute your project.
9+
It uses the [.NET CLI](https://docs.microsoft.com/dotnet/articles/core/) to compile and execute your project.
1010

1111
## Useful commands
1212

Diff for: packages/aws-cdk/lib/init-templates/sample-app/fsharp/src/%name.PascalCased%/%name.PascalCased%.template.fsproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFramework>net6.0</TargetFramework>
66
<!-- Roll forward to future major versions of the netcoreapp as needed -->
77
<RollForward>Major</RollForward>
88
</PropertyGroup>

Diff for: packages/aws-cdk/test/init.test.ts

+4
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ describe('constructs version', () => {
5858
const sln = (await fs.readFile(slnFile, 'utf8')).split(/\r?\n/);
5959

6060
expect(csproj).toContainEqual(expect.stringMatching(/\<PackageReference Include="Constructs" Version="\[10\..*,11\..*\)"/));
61+
expect(csproj).toContainEqual(expect.stringMatching(/\<TargetFramework>net6.0<\/TargetFramework>/));
6162
expect(sln).toContainEqual(expect.stringMatching(/\"AwsCdkTest[a-zA-Z0-9]{6}\\AwsCdkTest[a-zA-Z0-9]{6}.csproj\"/));
6263
});
6364

@@ -73,6 +74,7 @@ describe('constructs version', () => {
7374
const sln = (await fs.readFile(slnFile, 'utf8')).split(/\r?\n/);
7475

7576
expect(fsproj).toContainEqual(expect.stringMatching(/\<PackageReference Include="Constructs" Version="\[10\..*,11\..*\)"/));
77+
expect(fsproj).toContainEqual(expect.stringMatching(/\<TargetFramework>net6.0<\/TargetFramework>/));
7678
expect(sln).toContainEqual(expect.stringMatching(/\"AwsCdkTest[a-zA-Z0-9]{6}\\AwsCdkTest[a-zA-Z0-9]{6}.fsproj\"/));
7779
});
7880

@@ -85,6 +87,7 @@ describe('constructs version', () => {
8587
const csproj = (await fs.readFile(csprojFile, 'utf8')).split(/\r?\n/);
8688

8789
expect(csproj).toContainEqual(expect.stringMatching(/\<PackageReference Include="Constructs" Version="\[10\..*,11\..*\)"/));
90+
expect(csproj).toContainEqual(expect.stringMatching(/\<TargetFramework>net6.0<\/TargetFramework>/));
8891
});
8992

9093
cliTestWithDirSpaces('fsharp app with spaces', async (workDir) => {
@@ -96,6 +99,7 @@ describe('constructs version', () => {
9699
const fsproj = (await fs.readFile(fsprojFile, 'utf8')).split(/\r?\n/);
97100

98101
expect(fsproj).toContainEqual(expect.stringMatching(/\<PackageReference Include="Constructs" Version="\[10\..*,11\..*\)"/));
102+
expect(fsproj).toContainEqual(expect.stringMatching(/\<TargetFramework>net6.0<\/TargetFramework>/));
99103
});
100104

101105
cliTest('create a Python app project', async (workDir) => {

Diff for: scripts/check-build-prerequisites.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,13 @@ else
121121
fi
122122
fi
123123

124-
# [.NET == 3.1.x, == 5.x]
124+
# [.NET == 6.0.x]
125125
app="dotnet"
126-
app_min="3.1.0"
126+
app_min="6.0.100"
127127
check_which $app $app_min
128128
app_v=$(${app} --list-sdks)
129129
echo -e "Checking dotnet version... \c"
130-
if [ $(echo $app_v | grep -c -E "(3\.1\.[0-9]+|[5-7]\.[0-9]+\.[0-9]+)") -eq 1 ]
130+
if [ $(echo $app_v | grep -c -E "6\.[0-9]+\.[0-9]+") -eq 1 ]
131131
then
132132
echo "Ok"
133133
else

Diff for: scripts/check-pack-prerequisites.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ else
7979
wrong_version
8080
fi
8181

82-
# [.NET Core SDK 3.1.*]
82+
# [.NET SDK 6.0.*]
8383
app="dotnet"
84-
app_min="3.1.0"
84+
app_min="6.0.100"
8585
check_which $app $app_min
8686
app_v=$(${app} --list-sdks)
8787
echo -e "Checking $app version... \c"
88-
if [ $(echo $app_v | grep -c -E "3\.1\.[0-9].*|[4-9]\..*") -eq 1 ]
88+
if [ $(echo $app_v | grep -c -E "6\.0\.[0-9].*|[4-9]\..*") -eq 1 ]
8989
then
9090
echo "Ok"
9191
else

0 commit comments

Comments
 (0)