Skip to content

Commit c016b9b

Browse files
authored
C# 9 (#1298)
* C# 9 * netcoreapp3.1 -> net5.0 for source build
1 parent ce31135 commit c016b9b

File tree

15 files changed

+25
-25
lines changed

15 files changed

+25
-25
lines changed

docs/src/Binding/Binding.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
55
<TargetFramework>net5.0</TargetFramework>
6-
<LangVersion>preview</LangVersion>
6+
<LangVersion>9</LangVersion>
77
</PropertyGroup>
88

99
<ItemGroup>

eng/source-build-patches/0003-Update-to-netcoreapp3.1-to-avoid-prebuilts.patch

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
From b9a21ec1c0a77ef4e1e44840a0526545fea456de Mon Sep 17 00:00:00 2001
22
From: Davis Goodin <[email protected]>
33
Date: Thu, 29 Oct 2020 01:48:54 -0500
4-
Subject: [PATCH] Update to netcoreapp3.1 to avoid prebuilts
4+
Subject: [PATCH] Update to net5.0 to avoid prebuilts
55

6-
netcoreapp3.1 avoids prebuilts (Microsoft.CSharp) but works with the
6+
net5.0 avoids prebuilts (Microsoft.CSharp) but works with the
77
rest of source-build: runtime and roslyn.
88

99
Includes a code fix for ref nullability with the new framework.
@@ -24,7 +24,7 @@ index b3a542fd..06167997 100644
2424
<PropertyGroup>
2525
<IsPackable>true</IsPackable>
2626
- <TargetFramework>netstandard2.0</TargetFramework>
27-
+ <TargetFramework>netcoreapp3.1</TargetFramework>
27+
+ <TargetFramework>net5.0</TargetFramework>
2828
<Description>This package includes the experimental DragonFruit app model for System.CommandLine, which allows you to create a command line application using only a Main method while getting support for complex type binding, error reporting, help, shell completions, and more.
2929
</Description>
3030
</PropertyGroup>
@@ -37,8 +37,8 @@ index 1d00cff2..7342c1c5 100644
3737
<PropertyGroup>
3838
<IsPackable>true</IsPackable>
3939
- <TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
40-
+ <TargetFrameworks>netcoreapp3.1</TargetFrameworks>
41-
<LangVersion>latest</LangVersion>
40+
+ <TargetFrameworks>net5.0</TargetFrameworks>
41+
<LangVersion>9</LangVersion>
4242
<Description>This package provides support for using System.CommandLine with Microsoft.Extensions.Hosting.</Description>
4343
</PropertyGroup>
4444
diff --git a/src/System.CommandLine.Rendering/System.CommandLine.Rendering.csproj b/src/System.CommandLine.Rendering/System.CommandLine.Rendering.csproj
@@ -50,8 +50,8 @@ index d552286e..84026ebe 100644
5050
<PropertyGroup>
5151
<IsPackable>true</IsPackable>
5252
- <TargetFramework>netstandard2.0</TargetFramework>
53-
+ <TargetFramework>netcoreapp3.1</TargetFramework>
54-
<LangVersion>8</LangVersion>
53+
+ <TargetFramework>net5.0</TargetFramework>
54+
<LangVersion>9</LangVersion>
5555
<Description>This package provides support for structured command line output rendering. Write code once that renders correctly in multiple output modes, including System.Console, virtual terminal (using ANSI escape sequences), and plain text.
5656
</Description>
5757
diff --git a/src/System.CommandLine/Binding/BindingContext.cs b/src/System.CommandLine/Binding/BindingContext.cs
@@ -76,8 +76,8 @@ index aaa2c4a3..5e875a73 100644
7676
<IsPackable>true</IsPackable>
7777
<PackageId>System.CommandLine</PackageId>
7878
- <TargetFramework>netstandard2.0</TargetFramework>
79-
+ <TargetFramework>netcoreapp3.1</TargetFramework>
80-
<LangVersion>8</LangVersion>
79+
+ <TargetFramework>net5.0</TargetFramework>
80+
<LangVersion>9</LangVersion>
8181
<Nullable>enable</Nullable>
8282
<Description>This package includes a powerful command line parser and other tools for building command line applications, including:
8383
@@ -18,9 +18,4 @@

eng/source-build-patches/0004-Exclude-System.CommandLine.Hosting.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ index 7342c1c..e4a97a0 100644
1313
--- a/src/System.CommandLine.Hosting/System.CommandLine.Hosting.csproj
1414
+++ b/src/System.CommandLine.Hosting/System.CommandLine.Hosting.csproj
1515
@@ -5,6 +5,7 @@
16-
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
17-
<LangVersion>latest</LangVersion>
16+
<TargetFrameworks>net5.0</TargetFrameworks>
17+
<LangVersion>9</LangVersion>
1818
<Description>This package provides support for using System.CommandLine with Microsoft.Extensions.Hosting.</Description>
1919
+ <ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
2020
</PropertyGroup>
@@ -24,7 +24,7 @@ index 7342c1c..e4a97a0 100644
2424
+++ b/samples/HostingPlayground/HostingPlayground.csproj
2525
@@ -6,6 +6,7 @@
2626
<GenerateDocumentationFile>true</GenerateDocumentationFile>
27-
<LangVersion>8</LangVersion>
27+
<LangVersion>9</LangVersion>
2828
<NoWarn>$(NoWarn);CS1591</NoWarn>
2929
+ <ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
3030
</PropertyGroup>

eng/source-build-patches/0005-remove-duplicate-attributes.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ From: Omair Majid <[email protected]>
33
Date: Tue, 23 Feb 2021 16:09:49 -0500
44
Subject: [PATCH] Remove local nullability attributes
55

6-
We are targeting to netcoreapp3.1, which already has attributes built in.
6+
We are targeting to net5.0, which already has attributes built in.
77

88
---
99
diff --git a/src/System.Diagnostics.CodeAnalysis.cs b/src/System.Diagnostics.CodeAnalysis.cs

samples/HostingPlayground/HostingPlayground.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<OutputType>Exe</OutputType>
55
<TargetFramework>net5.0</TargetFramework>
66
<GenerateDocumentationFile>true</GenerateDocumentationFile>
7-
<LangVersion>8</LangVersion>
7+
<LangVersion>9</LangVersion>
88
<NoWarn>$(NoWarn);CS1591</NoWarn>
99
</PropertyGroup>
1010

samples/RenderingPlayground/RenderingPlayground.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<OutputType>Exe</OutputType>
55
<TargetFramework>net5.0</TargetFramework>
66
<GenerateDocumentationFile>true</GenerateDocumentationFile>
7-
<LangVersion>latest</LangVersion>
7+
<LangVersion>9</LangVersion>
88
<!--<StartupObject>RenderingPlayground.Program</StartupObject>-->
99
</PropertyGroup>
1010

src/System.CommandLine.Benchmarks/System.CommandLine.Benchmarks.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<TargetFrameworks Condition="'$(TargetFrameworks)' == ''">net5.0;</TargetFrameworks>
1414

1515
<!-- Use the latest C# compiler features -->
16-
<LangVersion>latest</LangVersion>
16+
<LangVersion>9</LangVersion>
1717

1818
<!-- This repo does not produce any libraries, therefore generating docs is disabled -->
1919
<GenerateDocumentationFile>False</GenerateDocumentationFile>

src/System.CommandLine.Hosting.Tests/System.CommandLine.Hosting.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<TargetFrameworks>net5.0</TargetFrameworks>
55
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net462</TargetFrameworks>
6-
<LangVersion>latest</LangVersion>
6+
<LangVersion>9</LangVersion>
77
<IsPackable>false</IsPackable>
88
</PropertyGroup>
99

src/System.CommandLine.Hosting/System.CommandLine.Hosting.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<IsPackable>true</IsPackable>
55
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
6-
<LangVersion>latest</LangVersion>
6+
<LangVersion>9</LangVersion>
77
<Description>This package provides support for using System.CommandLine with Microsoft.Extensions.Hosting.</Description>
88
</PropertyGroup>
99

src/System.CommandLine.Rendering.Tests/System.CommandLine.Rendering.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>net5.0</TargetFramework>
5-
<LangVersion>latest</LangVersion>
5+
<LangVersion>9</LangVersion>
66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
88

0 commit comments

Comments
 (0)