Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/renumber-sections.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Setup .NET 10.0
uses: actions/setup-dotnet@v6
with:
dotnet-version: 10.0.x
dotnet-version: 11.0.x

- name: Run section renumbering
env:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test-examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ jobs:
# 10.0 for the tools themselves. (The closer we
# are to the target language version we're standardising,
# the better.)
- name: Setup .NET 8.0 and 10.0
- name: Setup .NET 8.0, 10.0, and 11.0
uses: actions/setup-dotnet@v6
with:
dotnet-version: |
8.0.x
10.0.x
11.0.x

- name: Extract and validate tests
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tools-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Setup .NET 10.0
uses: actions/setup-dotnet@v6
with:
dotnet-version: 10.0.x
dotnet-version: 11.0.x

- name: Run all tests
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-on-merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ jobs:
- name: Check out our repo
uses: actions/checkout@v7.0.1

- name: Setup .NET 10.0
- name: Setup .NET 11.0
uses: actions/setup-dotnet@v6
with:
dotnet-version: 10.0.x
dotnet-version: 11.0.x

- name: Set up JDK 15
uses: actions/setup-java@v6
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/word-converter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ jobs:
- name: Check out our repo
uses: actions/checkout@v7.0.1

- name: Setup .NET 10.0
- name: Setup .NET 11.0
uses: actions/setup-dotnet@v6
with:
dotnet-version: 10.0.x
dotnet-version: 11.0.x

- name: Run converter
env:
Expand Down
2 changes: 1 addition & 1 deletion tools/ExampleExtractor/ExampleExtractor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net11.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion tools/ExampleFormatter/ExampleFormatter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net11.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion tools/ExampleTester.Tests/ExampleTester.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net11.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
34 changes: 19 additions & 15 deletions tools/ExampleTester.Tests/FastCsprojCompilationParserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,10 @@ private static void CompareMSBuildWorkspaceCompilation(string csprojContents, Cs

result.CompilationOptions.Equals(sanitizedCompilationOptions).ShouldBeTrue();

var sanitizedParseOptions = msbuildCompilation.SyntaxTrees.First().Options;
var sanitizedParseOptions = msbuildCompilation.SyntaxTrees.First().Options as CSharpParseOptions;

sanitizedParseOptions = sanitizedParseOptions.WithFeatures(result.ParseOptions.Features);
sanitizedParseOptions = sanitizedParseOptions?.WithFeatures(result.ParseOptions.Features)
.WithPreprocessorSymbols(result.ParseOptions.PreprocessorSymbolNames);
result.ParseOptions.Equals(sanitizedParseOptions).ShouldBeTrue();

var sanitizedSyntaxTrees = msbuildCompilation.SyntaxTrees
Expand All @@ -126,7 +127,10 @@ private static void CompareMSBuildWorkspaceCompilation(string csprojContents, Cs
{
var sanitizedGenerated = msbuildGenerated.WithRootAndOptions(
msbuildGenerated.GetRoot(),
((CSharpParseOptions)msbuildGenerated.Options).WithFeatures(((CSharpParseOptions)fastGenerated.Options).Features));
((CSharpParseOptions)msbuildGenerated.Options)
.WithFeatures(((CSharpParseOptions)fastGenerated.Options).Features).
WithPreprocessorSymbols(fastGenerated.Options.PreprocessorSymbolNames)).
WithChangedText(fastGenerated.GetText());
fastGenerated.Options.ShouldBe(sanitizedGenerated.Options);
fastGenerated.GetText().ToString().ShouldBe(sanitizedGenerated.GetText().ToString());
}
Expand Down Expand Up @@ -158,7 +162,7 @@ public static void Defaults()
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net11.0</TargetFramework>
</PropertyGroup>

</Project>
Expand All @@ -168,9 +172,9 @@ public static void Defaults()
result.CompilationOptions.NullableContextOptions.ShouldBe(NullableContextOptions.Disable);
result.AssemblyName.ShouldBe(Path.GetFileNameWithoutExtension(CsprojFileName));
result.CompilationOptions.AllowUnsafe.ShouldBeFalse();
result.ParseOptions.LanguageVersion.ShouldBe(LanguageVersion.CSharp14); // Due to net10.0
((int)result.ParseOptions.LanguageVersion).ShouldBe(1400);
result.CompilationOptions.WarningLevel.ShouldBe(10); // Due to net10.0
result.ParseOptions.LanguageVersion.ShouldBe(LanguageVersion.CSharp15); // Due to net11.0
((int)result.ParseOptions.LanguageVersion).ShouldBe(1500);
result.CompilationOptions.WarningLevel.ShouldBe(11); // Due to net11.0
result.GeneratedSources.ShouldBeEmpty();
}

Expand All @@ -181,11 +185,11 @@ public static void ParsesTargetFramework()
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net11.0</TargetFramework>
</PropertyGroup>

</Project>
""").TargetFramework.ShouldBe("net10.0");
""").TargetFramework.ShouldBe("net11.0");
}

[Test]
Expand All @@ -195,7 +199,7 @@ public static void ParsesOutputType([Values("Library", "Exe", "WinExe")] string
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net11.0</TargetFramework>
<OutputType>{outputType}</OutputType>
</PropertyGroup>

Expand All @@ -215,7 +219,7 @@ public static void ParsesNullable([Values("enable", "disable", "annotations", "w
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net11.0</TargetFramework>
<Nullable>{nullable}</Nullable>
</PropertyGroup>

Expand All @@ -236,7 +240,7 @@ public static void ParsesAssemblyName()
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net11.0</TargetFramework>
<AssemblyName>Xyz</AssemblyName>
</PropertyGroup>

Expand All @@ -251,7 +255,7 @@ public static void ParsesAllowUnsafeBlocks([Values("true", "false")] string allo
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net11.0</TargetFramework>
<AllowUnsafeBlocks>{allowUnsafeBlocks}</AllowUnsafeBlocks>
</PropertyGroup>

Expand All @@ -276,7 +280,7 @@ public static void ParsesImplicitUsings([Values("true", "enable", "false", "disa
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net11.0</TargetFramework>
<ImplicitUsings>{implicitUsings}</ImplicitUsings>
</PropertyGroup>

Expand All @@ -297,7 +301,7 @@ public static void ParsesImplicitUsings([Values("true", "enable", "false", "disa
global using System.Net.Http;
global using System.Threading;
global using System.Threading.Tasks;

""");
}
else
Expand Down
17 changes: 9 additions & 8 deletions tools/ExampleTester/ExampleTester.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net11.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateProgramFile>false</GenerateProgramFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Basic.Reference.Assemblies.Net60" Version="1.8.15" />
<PackageReference Include="Basic.Reference.Assemblies.Net70" Version="1.8.11" />
<PackageReference Include="Basic.Reference.Assemblies.Net80" Version="1.8.11" />
<PackageReference Include="Basic.Reference.Assemblies.Net90" Version="1.8.11" />
<PackageReference Include="Basic.Reference.Assemblies.Net100" Version="1.8.11" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="5.9.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="5.9.0" />
<PackageReference Include="Basic.Reference.Assemblies.Net70" Version="1.8.15" />
<PackageReference Include="Basic.Reference.Assemblies.Net80" Version="1.8.15" />
<PackageReference Include="Basic.Reference.Assemblies.Net90" Version="1.8.15" />
<PackageReference Include="Basic.Reference.Assemblies.Net100" Version="1.8.15" />
<PackageReference Include="Basic.Reference.Assemblies.Net110" Version="1.8.15" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="5.12.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="5.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.12.0" />
<PackageReference Include="NUnit" Version="5.0.0" />
<PackageReference Include="NUnit3TestAdapter" Version="6.3.1" />
Expand Down
6 changes: 4 additions & 2 deletions tools/ExampleTester/FastCsprojCompilationParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@ private sealed record TargetFrameworkInfo(
new("net8.0", new(Basic.Reference.Assemblies.Net80.References.All, LanguageVersion.CSharp12, DefaultWarningLevel: 8)),
new("net9.0", new(Basic.Reference.Assemblies.Net90.References.All, LanguageVersion.CSharp13, DefaultWarningLevel: 9)),
new("net10.0", new(Basic.Reference.Assemblies.Net100.References.All, LanguageVersion.CSharp14, DefaultWarningLevel: 10)),
new("net11.0", new(Basic.Reference.Assemblies.Net110.References.All, LanguageVersion.CSharp15, DefaultWarningLevel: 11)),
}.ToFrozenDictionary(StringComparer.OrdinalIgnoreCase);

private static readonly CSharpParseOptions DefaultParseOptions = new(preprocessorSymbols: [
"TRACE", "RELEASE", "NET", "NET10_0", "NETCOREAPP", "NET5_0_OR_GREATER", "NET6_0_OR_GREATER",
"NET7_0_OR_GREATER", "NET8_0_OR_GREATER", "NET9_0_OR_GREATER", "NET10_0_OR_GREATER",
"TRACE", "RELEASE", "NET", "NET10_0", "NET11_0", "NETCOREAPP",
"NET5_0_OR_GREATER", "NET6_0_OR_GREATER", "NET7_0_OR_GREATER", "NET8_0_OR_GREATER",
"NET9_0_OR_GREATER", "NET10_0_OR_GREATER", "NET11_0_OR_GREATER",
"NETCOREAPP1_0_OR_GREATER", "NETCOREAPP1_1_OR_GREATER", "NETCOREAPP2_0_OR_GREATER",
"NETCOREAPP2_1_OR_GREATER", "NETCOREAPP2_2_OR_GREATER", "NETCOREAPP3_0_OR_GREATER",
"NETCOREAPP3_1_OR_GREATER"]);
Expand Down
4 changes: 2 additions & 2 deletions tools/MarkdownConverter.Tests/MarkdownConverter.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net11.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
Expand Down
8 changes: 4 additions & 4 deletions tools/MarkdownConverter/MarkdownConverter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net11.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<NoWarn>NU1701</NoWarn>
Expand All @@ -11,9 +11,9 @@
<ItemGroup>
<PackageReference Include="csharp2colorized" Version="1.0.3" />
<PackageReference Include="DocumentFormat.OpenXml" Version="3.5.1" />
<PackageReference Include="FSharp.Core" Version="10.1.201" />
<PackageReference Include="FSharp.Formatting" Version="22.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis" Version="5.3.0" />
<PackageReference Include="FSharp.Core" Version="11.0.101" />
<PackageReference Include="FSharp.Formatting" Version="22.2.0" />
<PackageReference Include="Microsoft.CodeAnalysis" Version="5.12.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net11.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion tools/StandardAnchorTags/StandardAnchorTags.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net11.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion tools/Utilities.Tests/Utilities.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net11.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion tools/Utilities/Utilities.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net11.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
Loading