From ac1499ba0b3f5d648c4f9e7377a34ee1c15dc63d Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Tue, 16 Feb 2021 15:40:00 -0500 Subject: [PATCH] Enable arcade-powered-sourced-build for local and CI builds This enables 'source-build', which makes it easier to build the entire shipping .NET SDK from source. This is the first and second step of arcade-powered-source-build: https://github.com/dotnet/source-build/blob/master/Documentation/planning/arcade-powered-source-build/README.md See dotnet/sourcelink#692 for a similar PR, that this is based on. And try and resolve some nullability errors. For source-build, sisable warnings so we can build this without extensive customizations, since we update the TFM ourselves. --- .gitignore | 1 - .vsts-ci.yml | 1 + Directory.Build.props | 1 + eng/SourceBuild.props | 24 ++ eng/SourceBuildPrebuiltBaseline.xml | 5 + eng/Version.Details.xml | 1 + eng/common/dotnet-install.sh | 0 ...ude-dotnet-suggest-from-source-build.patch | 229 ++++++++++++++++++ ...ion-properties-for-reference-version.patch | 47 ++++ ...-to-netcoreapp3.1-to-avoid-prebuilts.patch | 95 ++++++++ ...4-Exclude-System.CommandLine.Hosting.patch | 35 +++ .../0005-remove-duplicate-attributes.patch | 99 ++++++++ 12 files changed, 537 insertions(+), 1 deletion(-) create mode 100644 eng/SourceBuild.props create mode 100644 eng/SourceBuildPrebuiltBaseline.xml mode change 100644 => 100755 eng/common/dotnet-install.sh create mode 100644 eng/source-build-patches/0001-Exclude-dotnet-suggest-from-source-build.patch create mode 100644 eng/source-build-patches/0002-Use-package-version-properties-for-reference-version.patch create mode 100644 eng/source-build-patches/0003-Update-to-netcoreapp3.1-to-avoid-prebuilts.patch create mode 100644 eng/source-build-patches/0004-Exclude-System.CommandLine.Hosting.patch create mode 100644 eng/source-build-patches/0005-remove-duplicate-attributes.patch diff --git a/.gitignore b/.gitignore index 3e10eb953..2c1e4168c 100644 --- a/.gitignore +++ b/.gitignore @@ -142,7 +142,6 @@ node_modules/ *.Tests/lib/ *.userprefs *.vsp -*.xml .idea _NCrunch_*/ _ReSharper.*/ diff --git a/.vsts-ci.yml b/.vsts-ci.yml index e4c5444f9..06e758892 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -29,6 +29,7 @@ stages: enablePublishTestResults: true enablePublishBuildAssets: true enableTelemetry: true + enableSourceBuild: true helixRepo: dotnet/command-line-api timeoutInMinutes: 180 # increase timeout since BAR publishing might wait a long time jobs: diff --git a/Directory.Build.props b/Directory.Build.props index 8cedc55fe..04e284114 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -6,6 +6,7 @@ $(NoWarn);NU5125;CS0618 + $(NoWarn);CS8714;CS8765;CS8600;CS8601;CS8602;CS8603;CS8604 MIT diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props new file mode 100644 index 000000000..6cc850181 --- /dev/null +++ b/eng/SourceBuild.props @@ -0,0 +1,24 @@ + + + + command-line-api + true + + + + + + + + + + + + diff --git a/eng/SourceBuildPrebuiltBaseline.xml b/eng/SourceBuildPrebuiltBaseline.xml new file mode 100644 index 000000000..c1b6dfbf0 --- /dev/null +++ b/eng/SourceBuildPrebuiltBaseline.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index b1aed568e..ff2a6eda1 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -6,6 +6,7 @@ https://github.com/dotnet/arcade 938b3e8b4edcd96ca0f0cbbae63c87b3f51f7afe + diff --git a/eng/common/dotnet-install.sh b/eng/common/dotnet-install.sh old mode 100644 new mode 100755 diff --git a/eng/source-build-patches/0001-Exclude-dotnet-suggest-from-source-build.patch b/eng/source-build-patches/0001-Exclude-dotnet-suggest-from-source-build.patch new file mode 100644 index 000000000..c27a90c5d --- /dev/null +++ b/eng/source-build-patches/0001-Exclude-dotnet-suggest-from-source-build.patch @@ -0,0 +1,229 @@ +From aafb58d2919b4ebe663cd61fd7fc622358da2ce5 Mon Sep 17 00:00:00 2001 +From: Chris Rummel +Date: Fri, 18 Sep 2020 16:09:49 -0500 +Subject: [PATCH 1/3] Exclude dotnet-suggest from source-build. + +This is not used by any downstream repos in source-build and adds a +bunch of prebuilts, so we can leave this out for now. +--- + System.CommandLine.sln | 134 ------------------ + .../dotnet-suggest.csproj | 1 + + 2 files changed, 1 insertion(+), 134 deletions(-) + +diff --git a/System.CommandLine.sln b/System.CommandLine.sln +index ec97010..102aefe 100644 +--- a/System.CommandLine.sln ++++ b/System.CommandLine.sln +@@ -30,31 +30,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E5B1EC71-0FC + EndProject + Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.CommandLine", "src\System.CommandLine\System.CommandLine.csproj", "{0BE8E56E-7580-4526-BE24-D304E1779724}" + EndProject +-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.CommandLine.Tests", "src\System.CommandLine.Tests\System.CommandLine.Tests.csproj", "{F843CCCA-4CC9-422C-A881-3AE6A998B53F}" +-EndProject + Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{6749FB3E-39DE-4321-A39E-525278E9408D}" + EndProject +-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragonFruit", "samples\DragonFruit\DragonFruit.csproj", "{8A592CB0-5FB9-4E70-A68A-BE5B5BE23C00}" +-EndProject + Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.CommandLine.DragonFruit", "src\System.CommandLine.DragonFruit\System.CommandLine.DragonFruit.csproj", "{EEC30462-078F-45EB-AA70-12E3170CD51E}" + EndProject +-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.CommandLine.DragonFruit.Tests", "src\System.CommandLine.DragonFruit.Tests\System.CommandLine.DragonFruit.Tests.csproj", "{1F4B2074-F651-4A02-A860-7DDA74B2CC5F}" +-EndProject +-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-suggest", "src\System.CommandLine.Suggest\dotnet-suggest.csproj", "{E23C760E-B826-4B4F-BE76-916D86BAD2DB}" +-EndProject +-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-suggest.Tests", "src\System.CommandLine.Suggest.Tests\dotnet-suggest.Tests.csproj", "{E41F0471-B14D-4FA0-9D8B-1E7750695AE9}" +-EndProject +-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RenderingPlayground", "samples\RenderingPlayground\RenderingPlayground.csproj", "{8D9A8DCB-DC74-4B3A-B1C6-046C9C4F458E}" +-EndProject + Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.CommandLine.Rendering", "src\System.CommandLine.Rendering\System.CommandLine.Rendering.csproj", "{27E3BFFC-4412-4E4C-A656-B9D35B8A0F3E}" + EndProject +-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.CommandLine.Rendering.Tests", "src\System.CommandLine.Rendering.Tests\System.CommandLine.Rendering.Tests.csproj", "{9E574595-A9CD-441A-9328-1D4DD5B531E8}" +-EndProject +-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.CommandLine.Benchmarks", "src\System.CommandLine.Benchmarks\System.CommandLine.Benchmarks.csproj", "{C39B0705-993E-43DB-B66A-A37A587F0BF7}" +-EndProject + Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.CommandLine.Hosting", "src\System.CommandLine.Hosting\System.CommandLine.Hosting.csproj", "{644C4B4A-4A32-4307-9F71-C3BF901FFB66}" + EndProject +-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.CommandLine.Hosting.Tests", "src\System.CommandLine.Hosting.Tests\System.CommandLine.Hosting.Tests.csproj", "{39483140-BC26-4CAD-BBAE-3DC76C2F16CF}" + EndProject + Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HostingPlayground", "samples\HostingPlayground\HostingPlayground.csproj", "{0BF6958D-9EE3-4623-B3D6-4DA77EAC1906}" + EndProject +@@ -78,30 +61,6 @@ Global + {0BE8E56E-7580-4526-BE24-D304E1779724}.Release|x64.Build.0 = Release|Any CPU + {0BE8E56E-7580-4526-BE24-D304E1779724}.Release|x86.ActiveCfg = Release|Any CPU + {0BE8E56E-7580-4526-BE24-D304E1779724}.Release|x86.Build.0 = Release|Any CPU +- {F843CCCA-4CC9-422C-A881-3AE6A998B53F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +- {F843CCCA-4CC9-422C-A881-3AE6A998B53F}.Debug|Any CPU.Build.0 = Debug|Any CPU +- {F843CCCA-4CC9-422C-A881-3AE6A998B53F}.Debug|x64.ActiveCfg = Debug|Any CPU +- {F843CCCA-4CC9-422C-A881-3AE6A998B53F}.Debug|x64.Build.0 = Debug|Any CPU +- {F843CCCA-4CC9-422C-A881-3AE6A998B53F}.Debug|x86.ActiveCfg = Debug|Any CPU +- {F843CCCA-4CC9-422C-A881-3AE6A998B53F}.Debug|x86.Build.0 = Debug|Any CPU +- {F843CCCA-4CC9-422C-A881-3AE6A998B53F}.Release|Any CPU.ActiveCfg = Release|Any CPU +- {F843CCCA-4CC9-422C-A881-3AE6A998B53F}.Release|Any CPU.Build.0 = Release|Any CPU +- {F843CCCA-4CC9-422C-A881-3AE6A998B53F}.Release|x64.ActiveCfg = Release|Any CPU +- {F843CCCA-4CC9-422C-A881-3AE6A998B53F}.Release|x64.Build.0 = Release|Any CPU +- {F843CCCA-4CC9-422C-A881-3AE6A998B53F}.Release|x86.ActiveCfg = Release|Any CPU +- {F843CCCA-4CC9-422C-A881-3AE6A998B53F}.Release|x86.Build.0 = Release|Any CPU +- {8A592CB0-5FB9-4E70-A68A-BE5B5BE23C00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +- {8A592CB0-5FB9-4E70-A68A-BE5B5BE23C00}.Debug|Any CPU.Build.0 = Debug|Any CPU +- {8A592CB0-5FB9-4E70-A68A-BE5B5BE23C00}.Debug|x64.ActiveCfg = Debug|Any CPU +- {8A592CB0-5FB9-4E70-A68A-BE5B5BE23C00}.Debug|x64.Build.0 = Debug|Any CPU +- {8A592CB0-5FB9-4E70-A68A-BE5B5BE23C00}.Debug|x86.ActiveCfg = Debug|Any CPU +- {8A592CB0-5FB9-4E70-A68A-BE5B5BE23C00}.Debug|x86.Build.0 = Debug|Any CPU +- {8A592CB0-5FB9-4E70-A68A-BE5B5BE23C00}.Release|Any CPU.ActiveCfg = Release|Any CPU +- {8A592CB0-5FB9-4E70-A68A-BE5B5BE23C00}.Release|Any CPU.Build.0 = Release|Any CPU +- {8A592CB0-5FB9-4E70-A68A-BE5B5BE23C00}.Release|x64.ActiveCfg = Release|Any CPU +- {8A592CB0-5FB9-4E70-A68A-BE5B5BE23C00}.Release|x64.Build.0 = Release|Any CPU +- {8A592CB0-5FB9-4E70-A68A-BE5B5BE23C00}.Release|x86.ActiveCfg = Release|Any CPU +- {8A592CB0-5FB9-4E70-A68A-BE5B5BE23C00}.Release|x86.Build.0 = Release|Any CPU + {EEC30462-078F-45EB-AA70-12E3170CD51E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EEC30462-078F-45EB-AA70-12E3170CD51E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EEC30462-078F-45EB-AA70-12E3170CD51E}.Debug|x64.ActiveCfg = Debug|Any CPU +@@ -114,54 +73,6 @@ Global + {EEC30462-078F-45EB-AA70-12E3170CD51E}.Release|x64.Build.0 = Release|Any CPU + {EEC30462-078F-45EB-AA70-12E3170CD51E}.Release|x86.ActiveCfg = Release|Any CPU + {EEC30462-078F-45EB-AA70-12E3170CD51E}.Release|x86.Build.0 = Release|Any CPU +- {1F4B2074-F651-4A02-A860-7DDA74B2CC5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +- {1F4B2074-F651-4A02-A860-7DDA74B2CC5F}.Debug|Any CPU.Build.0 = Debug|Any CPU +- {1F4B2074-F651-4A02-A860-7DDA74B2CC5F}.Debug|x64.ActiveCfg = Debug|Any CPU +- {1F4B2074-F651-4A02-A860-7DDA74B2CC5F}.Debug|x64.Build.0 = Debug|Any CPU +- {1F4B2074-F651-4A02-A860-7DDA74B2CC5F}.Debug|x86.ActiveCfg = Debug|Any CPU +- {1F4B2074-F651-4A02-A860-7DDA74B2CC5F}.Debug|x86.Build.0 = Debug|Any CPU +- {1F4B2074-F651-4A02-A860-7DDA74B2CC5F}.Release|Any CPU.ActiveCfg = Release|Any CPU +- {1F4B2074-F651-4A02-A860-7DDA74B2CC5F}.Release|Any CPU.Build.0 = Release|Any CPU +- {1F4B2074-F651-4A02-A860-7DDA74B2CC5F}.Release|x64.ActiveCfg = Release|Any CPU +- {1F4B2074-F651-4A02-A860-7DDA74B2CC5F}.Release|x64.Build.0 = Release|Any CPU +- {1F4B2074-F651-4A02-A860-7DDA74B2CC5F}.Release|x86.ActiveCfg = Release|Any CPU +- {1F4B2074-F651-4A02-A860-7DDA74B2CC5F}.Release|x86.Build.0 = Release|Any CPU +- {E23C760E-B826-4B4F-BE76-916D86BAD2DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +- {E23C760E-B826-4B4F-BE76-916D86BAD2DB}.Debug|Any CPU.Build.0 = Debug|Any CPU +- {E23C760E-B826-4B4F-BE76-916D86BAD2DB}.Debug|x64.ActiveCfg = Debug|Any CPU +- {E23C760E-B826-4B4F-BE76-916D86BAD2DB}.Debug|x64.Build.0 = Debug|Any CPU +- {E23C760E-B826-4B4F-BE76-916D86BAD2DB}.Debug|x86.ActiveCfg = Debug|Any CPU +- {E23C760E-B826-4B4F-BE76-916D86BAD2DB}.Debug|x86.Build.0 = Debug|Any CPU +- {E23C760E-B826-4B4F-BE76-916D86BAD2DB}.Release|Any CPU.ActiveCfg = Release|Any CPU +- {E23C760E-B826-4B4F-BE76-916D86BAD2DB}.Release|Any CPU.Build.0 = Release|Any CPU +- {E23C760E-B826-4B4F-BE76-916D86BAD2DB}.Release|x64.ActiveCfg = Release|Any CPU +- {E23C760E-B826-4B4F-BE76-916D86BAD2DB}.Release|x64.Build.0 = Release|Any CPU +- {E23C760E-B826-4B4F-BE76-916D86BAD2DB}.Release|x86.ActiveCfg = Release|Any CPU +- {E23C760E-B826-4B4F-BE76-916D86BAD2DB}.Release|x86.Build.0 = Release|Any CPU +- {E41F0471-B14D-4FA0-9D8B-1E7750695AE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +- {E41F0471-B14D-4FA0-9D8B-1E7750695AE9}.Debug|Any CPU.Build.0 = Debug|Any CPU +- {E41F0471-B14D-4FA0-9D8B-1E7750695AE9}.Debug|x64.ActiveCfg = Debug|Any CPU +- {E41F0471-B14D-4FA0-9D8B-1E7750695AE9}.Debug|x64.Build.0 = Debug|Any CPU +- {E41F0471-B14D-4FA0-9D8B-1E7750695AE9}.Debug|x86.ActiveCfg = Debug|Any CPU +- {E41F0471-B14D-4FA0-9D8B-1E7750695AE9}.Debug|x86.Build.0 = Debug|Any CPU +- {E41F0471-B14D-4FA0-9D8B-1E7750695AE9}.Release|Any CPU.ActiveCfg = Release|Any CPU +- {E41F0471-B14D-4FA0-9D8B-1E7750695AE9}.Release|Any CPU.Build.0 = Release|Any CPU +- {E41F0471-B14D-4FA0-9D8B-1E7750695AE9}.Release|x64.ActiveCfg = Release|Any CPU +- {E41F0471-B14D-4FA0-9D8B-1E7750695AE9}.Release|x64.Build.0 = Release|Any CPU +- {E41F0471-B14D-4FA0-9D8B-1E7750695AE9}.Release|x86.ActiveCfg = Release|Any CPU +- {E41F0471-B14D-4FA0-9D8B-1E7750695AE9}.Release|x86.Build.0 = Release|Any CPU +- {8D9A8DCB-DC74-4B3A-B1C6-046C9C4F458E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +- {8D9A8DCB-DC74-4B3A-B1C6-046C9C4F458E}.Debug|Any CPU.Build.0 = Debug|Any CPU +- {8D9A8DCB-DC74-4B3A-B1C6-046C9C4F458E}.Debug|x64.ActiveCfg = Debug|Any CPU +- {8D9A8DCB-DC74-4B3A-B1C6-046C9C4F458E}.Debug|x64.Build.0 = Debug|Any CPU +- {8D9A8DCB-DC74-4B3A-B1C6-046C9C4F458E}.Debug|x86.ActiveCfg = Debug|Any CPU +- {8D9A8DCB-DC74-4B3A-B1C6-046C9C4F458E}.Debug|x86.Build.0 = Debug|Any CPU +- {8D9A8DCB-DC74-4B3A-B1C6-046C9C4F458E}.Release|Any CPU.ActiveCfg = Release|Any CPU +- {8D9A8DCB-DC74-4B3A-B1C6-046C9C4F458E}.Release|Any CPU.Build.0 = Release|Any CPU +- {8D9A8DCB-DC74-4B3A-B1C6-046C9C4F458E}.Release|x64.ActiveCfg = Release|Any CPU +- {8D9A8DCB-DC74-4B3A-B1C6-046C9C4F458E}.Release|x64.Build.0 = Release|Any CPU +- {8D9A8DCB-DC74-4B3A-B1C6-046C9C4F458E}.Release|x86.ActiveCfg = Release|Any CPU +- {8D9A8DCB-DC74-4B3A-B1C6-046C9C4F458E}.Release|x86.Build.0 = Release|Any CPU + {27E3BFFC-4412-4E4C-A656-B9D35B8A0F3E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {27E3BFFC-4412-4E4C-A656-B9D35B8A0F3E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {27E3BFFC-4412-4E4C-A656-B9D35B8A0F3E}.Debug|x64.ActiveCfg = Debug|Any CPU +@@ -174,30 +85,6 @@ Global + {27E3BFFC-4412-4E4C-A656-B9D35B8A0F3E}.Release|x64.Build.0 = Release|Any CPU + {27E3BFFC-4412-4E4C-A656-B9D35B8A0F3E}.Release|x86.ActiveCfg = Release|Any CPU + {27E3BFFC-4412-4E4C-A656-B9D35B8A0F3E}.Release|x86.Build.0 = Release|Any CPU +- {9E574595-A9CD-441A-9328-1D4DD5B531E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +- {9E574595-A9CD-441A-9328-1D4DD5B531E8}.Debug|Any CPU.Build.0 = Debug|Any CPU +- {9E574595-A9CD-441A-9328-1D4DD5B531E8}.Debug|x64.ActiveCfg = Debug|Any CPU +- {9E574595-A9CD-441A-9328-1D4DD5B531E8}.Debug|x64.Build.0 = Debug|Any CPU +- {9E574595-A9CD-441A-9328-1D4DD5B531E8}.Debug|x86.ActiveCfg = Debug|Any CPU +- {9E574595-A9CD-441A-9328-1D4DD5B531E8}.Debug|x86.Build.0 = Debug|Any CPU +- {9E574595-A9CD-441A-9328-1D4DD5B531E8}.Release|Any CPU.ActiveCfg = Release|Any CPU +- {9E574595-A9CD-441A-9328-1D4DD5B531E8}.Release|Any CPU.Build.0 = Release|Any CPU +- {9E574595-A9CD-441A-9328-1D4DD5B531E8}.Release|x64.ActiveCfg = Release|Any CPU +- {9E574595-A9CD-441A-9328-1D4DD5B531E8}.Release|x64.Build.0 = Release|Any CPU +- {9E574595-A9CD-441A-9328-1D4DD5B531E8}.Release|x86.ActiveCfg = Release|Any CPU +- {9E574595-A9CD-441A-9328-1D4DD5B531E8}.Release|x86.Build.0 = Release|Any CPU +- {C39B0705-993E-43DB-B66A-A37A587F0BF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +- {C39B0705-993E-43DB-B66A-A37A587F0BF7}.Debug|Any CPU.Build.0 = Debug|Any CPU +- {C39B0705-993E-43DB-B66A-A37A587F0BF7}.Debug|x64.ActiveCfg = Debug|Any CPU +- {C39B0705-993E-43DB-B66A-A37A587F0BF7}.Debug|x64.Build.0 = Debug|Any CPU +- {C39B0705-993E-43DB-B66A-A37A587F0BF7}.Debug|x86.ActiveCfg = Debug|Any CPU +- {C39B0705-993E-43DB-B66A-A37A587F0BF7}.Debug|x86.Build.0 = Debug|Any CPU +- {C39B0705-993E-43DB-B66A-A37A587F0BF7}.Release|Any CPU.ActiveCfg = Release|Any CPU +- {C39B0705-993E-43DB-B66A-A37A587F0BF7}.Release|Any CPU.Build.0 = Release|Any CPU +- {C39B0705-993E-43DB-B66A-A37A587F0BF7}.Release|x64.ActiveCfg = Release|Any CPU +- {C39B0705-993E-43DB-B66A-A37A587F0BF7}.Release|x64.Build.0 = Release|Any CPU +- {C39B0705-993E-43DB-B66A-A37A587F0BF7}.Release|x86.ActiveCfg = Release|Any CPU +- {C39B0705-993E-43DB-B66A-A37A587F0BF7}.Release|x86.Build.0 = Release|Any CPU + {644C4B4A-4A32-4307-9F71-C3BF901FFB66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {644C4B4A-4A32-4307-9F71-C3BF901FFB66}.Debug|Any CPU.Build.0 = Debug|Any CPU + {644C4B4A-4A32-4307-9F71-C3BF901FFB66}.Debug|x64.ActiveCfg = Debug|Any CPU +@@ -210,48 +97,27 @@ Global + {644C4B4A-4A32-4307-9F71-C3BF901FFB66}.Release|x64.Build.0 = Release|Any CPU + {644C4B4A-4A32-4307-9F71-C3BF901FFB66}.Release|x86.ActiveCfg = Release|Any CPU + {644C4B4A-4A32-4307-9F71-C3BF901FFB66}.Release|x86.Build.0 = Release|Any CPU +- {39483140-BC26-4CAD-BBAE-3DC76C2F16CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +- {39483140-BC26-4CAD-BBAE-3DC76C2F16CF}.Debug|Any CPU.Build.0 = Debug|Any CPU +- {39483140-BC26-4CAD-BBAE-3DC76C2F16CF}.Debug|x64.ActiveCfg = Debug|Any CPU +- {39483140-BC26-4CAD-BBAE-3DC76C2F16CF}.Debug|x64.Build.0 = Debug|Any CPU +- {39483140-BC26-4CAD-BBAE-3DC76C2F16CF}.Debug|x86.ActiveCfg = Debug|Any CPU +- {39483140-BC26-4CAD-BBAE-3DC76C2F16CF}.Debug|x86.Build.0 = Debug|Any CPU +- {39483140-BC26-4CAD-BBAE-3DC76C2F16CF}.Release|Any CPU.ActiveCfg = Release|Any CPU +- {39483140-BC26-4CAD-BBAE-3DC76C2F16CF}.Release|Any CPU.Build.0 = Release|Any CPU +- {39483140-BC26-4CAD-BBAE-3DC76C2F16CF}.Release|x64.ActiveCfg = Release|Any CPU +- {39483140-BC26-4CAD-BBAE-3DC76C2F16CF}.Release|x64.Build.0 = Release|Any CPU +- {39483140-BC26-4CAD-BBAE-3DC76C2F16CF}.Release|x86.ActiveCfg = Release|Any CPU +- {39483140-BC26-4CAD-BBAE-3DC76C2F16CF}.Release|x86.Build.0 = Release|Any CPU + {0BF6958D-9EE3-4623-B3D6-4DA77EAC1906}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0BF6958D-9EE3-4623-B3D6-4DA77EAC1906}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0BF6958D-9EE3-4623-B3D6-4DA77EAC1906}.Debug|x64.ActiveCfg = Debug|Any CPU + {0BF6958D-9EE3-4623-B3D6-4DA77EAC1906}.Debug|x64.Build.0 = Debug|Any CPU + {0BF6958D-9EE3-4623-B3D6-4DA77EAC1906}.Debug|x86.ActiveCfg = Debug|Any CPU + {0BF6958D-9EE3-4623-B3D6-4DA77EAC1906}.Debug|x86.Build.0 = Debug|Any CPU + {0BF6958D-9EE3-4623-B3D6-4DA77EAC1906}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0BF6958D-9EE3-4623-B3D6-4DA77EAC1906}.Release|Any CPU.Build.0 = Release|Any CPU + {0BF6958D-9EE3-4623-B3D6-4DA77EAC1906}.Release|x64.ActiveCfg = Release|Any CPU + {0BF6958D-9EE3-4623-B3D6-4DA77EAC1906}.Release|x64.Build.0 = Release|Any CPU + {0BF6958D-9EE3-4623-B3D6-4DA77EAC1906}.Release|x86.ActiveCfg = Release|Any CPU + {0BF6958D-9EE3-4623-B3D6-4DA77EAC1906}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {0BE8E56E-7580-4526-BE24-D304E1779724} = {E5B1EC71-0FC4-4FAA-9C65-32D5016FBC45} +- {F843CCCA-4CC9-422C-A881-3AE6A998B53F} = {E5B1EC71-0FC4-4FAA-9C65-32D5016FBC45} +- {8A592CB0-5FB9-4E70-A68A-BE5B5BE23C00} = {6749FB3E-39DE-4321-A39E-525278E9408D} + {EEC30462-078F-45EB-AA70-12E3170CD51E} = {E5B1EC71-0FC4-4FAA-9C65-32D5016FBC45} +- {1F4B2074-F651-4A02-A860-7DDA74B2CC5F} = {E5B1EC71-0FC4-4FAA-9C65-32D5016FBC45} +- {E23C760E-B826-4B4F-BE76-916D86BAD2DB} = {E5B1EC71-0FC4-4FAA-9C65-32D5016FBC45} +- {E41F0471-B14D-4FA0-9D8B-1E7750695AE9} = {E5B1EC71-0FC4-4FAA-9C65-32D5016FBC45} +- {8D9A8DCB-DC74-4B3A-B1C6-046C9C4F458E} = {6749FB3E-39DE-4321-A39E-525278E9408D} + {27E3BFFC-4412-4E4C-A656-B9D35B8A0F3E} = {E5B1EC71-0FC4-4FAA-9C65-32D5016FBC45} +- {9E574595-A9CD-441A-9328-1D4DD5B531E8} = {E5B1EC71-0FC4-4FAA-9C65-32D5016FBC45} +- {C39B0705-993E-43DB-B66A-A37A587F0BF7} = {E5B1EC71-0FC4-4FAA-9C65-32D5016FBC45} + {644C4B4A-4A32-4307-9F71-C3BF901FFB66} = {E5B1EC71-0FC4-4FAA-9C65-32D5016FBC45} +- {39483140-BC26-4CAD-BBAE-3DC76C2F16CF} = {E5B1EC71-0FC4-4FAA-9C65-32D5016FBC45} + {0BF6958D-9EE3-4623-B3D6-4DA77EAC1906} = {6749FB3E-39DE-4321-A39E-525278E9408D} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution +diff --git a/src/System.CommandLine.Suggest/dotnet-suggest.csproj b/src/System.CommandLine.Suggest/dotnet-suggest.csproj +index f529484..ef9c3bb 100644 +--- a/src/System.CommandLine.Suggest/dotnet-suggest.csproj ++++ b/src/System.CommandLine.Suggest/dotnet-suggest.csproj +@@ -13,6 +13,7 @@ + .$(VersionSuffixDateStamp).$(VersionSuffixBuildOfTheDay) + 1.1$(DotnetSuggestBuildNumber) + ++ true + + + +-- +2.18.0 + diff --git a/eng/source-build-patches/0002-Use-package-version-properties-for-reference-version.patch b/eng/source-build-patches/0002-Use-package-version-properties-for-reference-version.patch new file mode 100644 index 000000000..de512e27d --- /dev/null +++ b/eng/source-build-patches/0002-Use-package-version-properties-for-reference-version.patch @@ -0,0 +1,47 @@ +From 74c9b072853ff4d68f2630462a6f1ac5d576979d Mon Sep 17 00:00:00 2001 +From: Chris Rummel +Date: Mon, 21 Sep 2020 09:59:02 -0500 +Subject: [PATCH 2/2] Use package version properties for reference versions. + +--- + eng/Versions.props | 7 +++++-- + src/System.CommandLine/System.CommandLine.csproj | 4 ++-- + 2 files changed, 7 insertions(+), 4 deletions(-) + +diff --git a/eng/Versions.props b/eng/Versions.props +index 3048701..16a0eb7 100644 +--- a/eng/Versions.props ++++ b/eng/Versions.props +@@ -29,9 +29,12 @@ + true + true + +- ++ 2.2.0 ++ 4.4.1 ++ 4.5.3 ++ + +diff --git a/src/System.CommandLine/System.CommandLine.csproj b/src/System.CommandLine/System.CommandLine.csproj +index 1ae8dd3..aaa2c4a 100644 +--- a/src/System.CommandLine/System.CommandLine.csproj ++++ b/src/System.CommandLine/System.CommandLine.csproj +@@ -19,8 +19,8 @@ + + + +- +- ++ ++ + + + +-- +2.18.0 + diff --git a/eng/source-build-patches/0003-Update-to-netcoreapp3.1-to-avoid-prebuilts.patch b/eng/source-build-patches/0003-Update-to-netcoreapp3.1-to-avoid-prebuilts.patch new file mode 100644 index 000000000..11fe4f7d1 --- /dev/null +++ b/eng/source-build-patches/0003-Update-to-netcoreapp3.1-to-avoid-prebuilts.patch @@ -0,0 +1,95 @@ +From b9a21ec1c0a77ef4e1e44840a0526545fea456de Mon Sep 17 00:00:00 2001 +From: Davis Goodin +Date: Thu, 29 Oct 2020 01:48:54 -0500 +Subject: [PATCH] Update to netcoreapp3.1 to avoid prebuilts + +netcoreapp3.1 avoids prebuilts (Microsoft.CSharp) but works with the +rest of source-build: runtime and roslyn. + +Includes a code fix for ref nullability with the new framework. +--- + .../System.CommandLine.DragonFruit.csproj | 2 +- + .../System.CommandLine.Hosting.csproj | 2 +- + .../System.CommandLine.Rendering.csproj | 2 +- + src/System.CommandLine/Binding/BindingContext.cs | 2 +- + src/System.CommandLine/System.CommandLine.csproj | 7 +------ + 5 files changed, 5 insertions(+), 10 deletions(-) + +diff --git a/src/System.CommandLine.DragonFruit/System.CommandLine.DragonFruit.csproj b/src/System.CommandLine.DragonFruit/System.CommandLine.DragonFruit.csproj +index b3a542fd..06167997 100644 +--- a/src/System.CommandLine.DragonFruit/System.CommandLine.DragonFruit.csproj ++++ b/src/System.CommandLine.DragonFruit/System.CommandLine.DragonFruit.csproj +@@ -1,7 +1,7 @@ +  + + true +- netstandard2.0 ++ netcoreapp3.1 + 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. + + +diff --git a/src/System.CommandLine.Hosting/System.CommandLine.Hosting.csproj b/src/System.CommandLine.Hosting/System.CommandLine.Hosting.csproj +index 1d00cff2..7342c1c5 100644 +--- a/src/System.CommandLine.Hosting/System.CommandLine.Hosting.csproj ++++ b/src/System.CommandLine.Hosting/System.CommandLine.Hosting.csproj +@@ -2,7 +2,7 @@ + + + true +- netstandard2.0;netstandard2.1 ++ netcoreapp3.1 + latest + This package provides support for using System.CommandLine with Microsoft.Extensions.Hosting. + +diff --git a/src/System.CommandLine.Rendering/System.CommandLine.Rendering.csproj b/src/System.CommandLine.Rendering/System.CommandLine.Rendering.csproj +index d552286e..84026ebe 100644 +--- a/src/System.CommandLine.Rendering/System.CommandLine.Rendering.csproj ++++ b/src/System.CommandLine.Rendering/System.CommandLine.Rendering.csproj +@@ -2,7 +2,7 @@ + + + true +- netstandard2.0 ++ netcoreapp3.1 + 8 + 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. + +diff --git a/src/System.CommandLine/Binding/BindingContext.cs b/src/System.CommandLine/Binding/BindingContext.cs +index b942ba6a..bbb83891 100644 +--- a/src/System.CommandLine/Binding/BindingContext.cs ++++ b/src/System.CommandLine/Binding/BindingContext.cs +@@ -55,7 +55,7 @@ namespace System.CommandLine.Binding + + public ModelBinder GetModelBinder(IValueDescriptor valueDescriptor) + { +- if (_modelBindersByValueDescriptor.TryGetValue(valueDescriptor.ValueType, out ModelBinder binder)) ++ if (_modelBindersByValueDescriptor.TryGetValue(valueDescriptor.ValueType, out ModelBinder? binder)) + { + return binder; + } +diff --git a/src/System.CommandLine/System.CommandLine.csproj b/src/System.CommandLine/System.CommandLine.csproj +index aaa2c4a3..5e875a73 100644 +--- a/src/System.CommandLine/System.CommandLine.csproj ++++ b/src/System.CommandLine/System.CommandLine.csproj +@@ -3,7 +3,7 @@ + + true + System.CommandLine +- netstandard2.0 ++ netcoreapp3.1 + 8 + enable + This package includes a powerful command line parser and other tools for building command line applications, including: +@@ -18,9 +18,4 @@ + + + +- +- +- +- +- + +-- +2.25.2 + diff --git a/eng/source-build-patches/0004-Exclude-System.CommandLine.Hosting.patch b/eng/source-build-patches/0004-Exclude-System.CommandLine.Hosting.patch new file mode 100644 index 000000000..62c39cce1 --- /dev/null +++ b/eng/source-build-patches/0004-Exclude-System.CommandLine.Hosting.patch @@ -0,0 +1,35 @@ +From f4053c72fd35e1ec0b238cb5f27f818b837a3632 Mon Sep 17 00:00:00 2001 +From: Davis Goodin +Date: Thu, 5 Nov 2020 10:48:59 -0600 +Subject: [PATCH] Exclude System.CommandLine.Hosting + +This project is not used by downstream repos and restores prebuilts. +--- + src/System.CommandLine.Hosting/System.CommandLine.Hosting.csproj | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/System.CommandLine.Hosting/System.CommandLine.Hosting.csproj b/src/System.CommandLine.Hosting/System.CommandLine.Hosting.csproj +index 7342c1c..e4a97a0 100644 +--- a/src/System.CommandLine.Hosting/System.CommandLine.Hosting.csproj ++++ b/src/System.CommandLine.Hosting/System.CommandLine.Hosting.csproj +@@ -5,6 +5,7 @@ + netcoreapp3.1 + latest + This package provides support for using System.CommandLine with Microsoft.Extensions.Hosting. ++ true + + + +--- a/samples/HostingPlayground/HostingPlayground.csproj ++++ b/samples/HostingPlayground/HostingPlayground.csproj +@@ -6,6 +6,7 @@ + true + 8 + $(NoWarn);CS1591 ++ true + + + +-- +2.25.2 + diff --git a/eng/source-build-patches/0005-remove-duplicate-attributes.patch b/eng/source-build-patches/0005-remove-duplicate-attributes.patch new file mode 100644 index 000000000..79a9fad74 --- /dev/null +++ b/eng/source-build-patches/0005-remove-duplicate-attributes.patch @@ -0,0 +1,99 @@ +From foobar Mon Sep 17 00:00:00 2001 +From: Omair Majid +Date: Tue, 23 Feb 2021 16:09:49 -0500 +Subject: [PATCH] Remove local nullability attributes + +We are targeting to netcoreapp3.1, which already has attributes built in. + +--- +diff --git a/src/System.Diagnostics.CodeAnalysis.cs b/src/System.Diagnostics.CodeAnalysis.cs +deleted file mode 100644 +index 8df0ee9..0000000 +--- a/src/System.Diagnostics.CodeAnalysis.cs ++++ /dev/null +@@ -1,70 +0,0 @@ +-// Licensed to the .NET Foundation under one or more agreements. +-// The .NET Foundation licenses this file to you under the MIT license. +-// See the LICENSE file in the project root for more information. +- +-#pragma warning disable CA1801, CA1822 +- +-namespace System.Diagnostics.CodeAnalysis +-{ +- [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false)] +- internal sealed class AllowNullAttribute : Attribute +- { +- } +- +- [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false)] +- internal sealed class DisallowNullAttribute : Attribute +- { +- } +- +- [AttributeUsage(AttributeTargets.Method, Inherited = false)] +- internal sealed class DoesNotReturnAttribute : Attribute +- { +- } +- +- [AttributeUsage(AttributeTargets.Parameter)] +- internal sealed class DoesNotReturnIfAttribute : Attribute +- { +- public DoesNotReturnIfAttribute(bool parameterValue) { } +- +- public bool ParameterValue { get { throw null!; } } +- } +- +- [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Event | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)] +- internal sealed class ExcludeFromCodeCoverageAttribute : Attribute +- { +- } +- +- [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, Inherited = false)] +- internal sealed class MaybeNullAttribute : Attribute +- { +- } +- +- [AttributeUsage(AttributeTargets.Parameter)] +- internal sealed class MaybeNullWhenAttribute : Attribute +- { +- public MaybeNullWhenAttribute(bool returnValue) { } +- +- public bool ReturnValue { get { throw null!; } } +- } +- +- [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, Inherited = false)] +- internal sealed class NotNullAttribute : Attribute +- { +- } +- +- [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)] +- internal sealed class NotNullIfNotNullAttribute : Attribute +- { +- public NotNullIfNotNullAttribute(string parameterName) { } +- +- public string ParameterName { get { throw null!; } } +- } +- +- [AttributeUsage(AttributeTargets.Parameter)] +- internal sealed class NotNullWhenAttribute : Attribute +- { +- public NotNullWhenAttribute(bool returnValue) { } +- +- public bool ReturnValue { get { throw null!; } } +- } +-} +\ No newline at end of file +diff --git a/src/System.CommandLine/System.CommandLine.csproj b/src/System.CommandLine/System.CommandLine.csproj +index bc666e8..4e52e94 100644 +--- a/src/System.CommandLine/System.CommandLine.csproj ++++ b/src/System.CommandLine/System.CommandLine.csproj +@@ -20,7 +20,9 @@ + + + ++ + + +