Skip to content

Commit f4b9908

Browse files
committed
Improve .NET SDK build infrastructure and documentation
- Add Central Package Management (Directory.Packages.props) with all package versions centralized - Add Directory.Build.props with shared properties (TargetFramework, ImplicitUsings, Nullable, TreatWarningsAsErrors) - Add nuget.config with single nuget.org source and package source mapping (required by CPM) - Add global.json specifying .NET 10 SDK (the library is still built with a net8.0 TFM) - Update all CI workflows from .NET 8.0.x to .NET 10.0.x - Enable XML documentation file generation (GenerateDocumentationFile) - Add XML doc comments to all non-generated public types and members - Add valid-value lists in XML docs for string properties with known values (e.g. PermissionRequest.Kind, ToolResultObject.ResultType) - Add #pragma warning disable CS1591 to generated files (SessionEvents.cs, Rpc.cs) and codegen scripts - Enable EmbedUntrackedSources, IncludeSymbols, SymbolPackageFormat - Enable ContinuousIntegrationBuild conditional on CI/TF_BUILD environment variables - Add PackageProjectUrl to package metadata - Add [EditorBrowsable(Never)] to obsolete GithubToken property - Upgrade analysis level and fix some diagnostics
1 parent dcd86c1 commit f4b9908

27 files changed

+808
-172
lines changed

.github/workflows/copilot-setup-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
- name: Set up .NET
5959
uses: actions/setup-dotnet@v5
6060
with:
61-
dotnet-version: "8.0.x"
61+
dotnet-version: "10.0.x"
6262

6363
# Install just command runner
6464
- name: Install just

.github/workflows/docs-validation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108

109109
- uses: actions/setup-dotnet@v5
110110
with:
111-
dotnet-version: "8.0.x"
111+
dotnet-version: "10.0.x"
112112

113113
- name: Install validation dependencies
114114
working-directory: scripts/docs-validation

.github/workflows/dotnet-sdk-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- uses: actions/checkout@v6.0.2
4444
- uses: actions/setup-dotnet@v5
4545
with:
46-
dotnet-version: "8.0.x"
46+
dotnet-version: "10.0.x"
4747
- uses: actions/setup-node@v6
4848
with:
4949
node-version: "22"

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ jobs:
121121
- uses: actions/checkout@v6.0.2
122122
- uses: actions/setup-dotnet@v5
123123
with:
124-
dotnet-version: "8.0.x"
124+
dotnet-version: "10.0.x"
125125
- name: Restore dependencies
126126
run: dotnet restore
127127
- name: Build and pack

.github/workflows/scenario-builds.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ jobs:
152152

153153
- uses: actions/setup-dotnet@v5
154154
with:
155-
dotnet-version: "8.0.x"
155+
dotnet-version: "10.0.x"
156156

157157
- uses: actions/cache@v4
158158
with:

.github/workflows/update-copilot-dependency.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838

3939
- uses: actions/setup-dotnet@v5
4040
with:
41-
dotnet-version: "8.0.x"
41+
dotnet-version: "10.0.x"
4242

4343
- name: Update @github/copilot in nodejs
4444
env:

dotnet/Directory.Build.props

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<LangVersion>14</LangVersion>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
<AnalysisLevel>10.0-minimum</AnalysisLevel>
9+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
10+
</PropertyGroup>
11+
12+
</Project>

dotnet/Directory.Packages.props

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
9+
<PackageVersion Include="Microsoft.Extensions.AI.Abstractions" Version="10.2.0" />
10+
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.2" />
11+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
12+
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="10.0.102" />
13+
<PackageVersion Include="StreamJsonRpc" Version="2.24.84" />
14+
<PackageVersion Include="System.Text.Json" Version="10.0.2" />
15+
<PackageVersion Include="xunit" Version="2.9.3" />
16+
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
17+
</ItemGroup>
18+
19+
</Project>

dotnet/global.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"sdk": {
3+
"version": "10.0.100",
4+
"rollForward": "major"
5+
}
6+
}

dotnet/nuget.config

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<clear />
5+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
6+
</packageSources>
7+
<packageSourceMapping>
8+
<packageSource key="nuget.org">
9+
<package pattern="*" />
10+
</packageSource>
11+
</packageSourceMapping>
12+
</configuration>

0 commit comments

Comments
 (0)