Skip to content

Commit fd825ec

Browse files
ANcpLuaclaude
andcommitted
chore: bump all packages to latest, cleanup dead code, fix BuildCheck version
- Version.props: bump 7 packages to latest stable (Meziantou, AwesomeAssertions, TestSdk, ANcpLua.Analyzers, Microsoft.OpenApi) - BuildCheck.props: update MSBuild version check from 17.8 to 18.0 - Common.targets: use self-closing XML for empty property initializers - SdkProjectBuilder: remove unused backward-compat region (7 methods) - CLAUDE.md: update test examples to fluent API - global.json: bump ANcpLua.NET.Sdk.Test to 2.23.1 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent fdd10cc commit fd825ec

6 files changed

Lines changed: 28 additions & 134 deletions

File tree

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"version": "10.0.103"
55
},
66
"msbuild-sdks": {
7-
"ANcpLua.NET.Sdk.Test": "2.22.1"
7+
"ANcpLua.NET.Sdk.Test": "2.23.1"
88
},
99
"test": {
1010
"runner": "Microsoft.Testing.Platform"

src/Build/Common/BuildCheck.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<Project>
22
<!--
33
═══════════════════════════════════════════════════════════════════════════
4-
BUILDCHECK INTEGRATION (.NET 9+)
4+
BUILDCHECK INTEGRATION (.NET 10+ / MSBuild 18.0+)
55
═══════════════════════════════════════════════════════════════════════════
66
77
BuildCheck runs at MSBuild evaluation time and catches common antipatterns.
88
Docs: https://learn.microsoft.com/en-us/dotnet/core/tools/buildcheck-rules
99
-->
1010

11-
<PropertyGroup Condition="$([MSBuild]::VersionGreaterThanOrEquals('$(MSBuildVersion)', '17.8'))">
11+
<PropertyGroup Condition="$([MSBuild]::VersionGreaterThanOrEquals('$(MSBuildVersion)', '18.0'))">
1212
<RunBuildCheck Condition="'$(DisableBuildCheck)' != 'true'">true</RunBuildCheck>
1313

1414
<!-- Treat as errors in CI -->
@@ -17,7 +17,7 @@
1717

1818
<!-- Rule Configuration -->
1919
<PropertyGroup Label="BuildCheck Rules"
20-
Condition="$([MSBuild]::VersionGreaterThanOrEquals('$(MSBuildVersion)', '17.8'))">
20+
Condition="$([MSBuild]::VersionGreaterThanOrEquals('$(MSBuildVersion)', '18.0'))">
2121
<!-- BC0101: Shared output path - MUST be error -->
2222
<BC0101Severity>Error</BC0101Severity>
2323

src/Build/Common/Common.targets

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@
292292

293293
<!-- Build test config section -->
294294
<PropertyGroup>
295-
<_ClaudeMdTestConfig></_ClaudeMdTestConfig>
295+
<_ClaudeMdTestConfig/>
296296
<_ClaudeMdTestConfig Condition="'$(IsTestProject)' == 'true' AND '$(SkipXunitInjection)' != 'true'">$(_ClaudeMdTestConfig)- xUnit v3 with Microsoft Testing Platform&#10;</_ClaudeMdTestConfig>
297297
<_ClaudeMdTestConfig Condition="'$(IsTestProject)' == 'true' AND '$(SkipXunitInjection)' == 'true'">$(_ClaudeMdTestConfig)- Custom test framework (xUnit skipped)&#10;</_ClaudeMdTestConfig>
298298
<_ClaudeMdTestConfig Condition="'$(IsTestProject)' == 'true'">$(_ClaudeMdTestConfig)- AwesomeAssertions&#10;</_ClaudeMdTestConfig>
@@ -302,13 +302,13 @@
302302

303303
<!-- Build SDK features section -->
304304
<PropertyGroup>
305-
<_ClaudeMdFeatures></_ClaudeMdFeatures>
305+
<_ClaudeMdFeatures/>
306306
<_ClaudeMdFeatures Condition="'$(UseRoslynUtilities)' == 'true'">$(_ClaudeMdFeatures)- Roslyn Utilities (EquatableArray, DiagnosticFlow)&#10;</_ClaudeMdFeatures>
307307
</PropertyGroup>
308308

309309
<!-- Build banned APIs section -->
310310
<PropertyGroup>
311-
<_ClaudeMdBannedApis></_ClaudeMdBannedApis>
311+
<_ClaudeMdBannedApis/>
312312
<_ClaudeMdBannedApis>$(_ClaudeMdBannedApis)- Use `TimeProvider` instead of current-time APIs&#10;</_ClaudeMdBannedApis>
313313
<_ClaudeMdBannedApis>$(_ClaudeMdBannedApis)- Use `Lock` instead of `object` for locking&#10;</_ClaudeMdBannedApis>
314314
<_ClaudeMdBannedApis>$(_ClaudeMdBannedApis)- Use `System.Text.Json` instead of Newtonsoft&#10;</_ClaudeMdBannedApis>

src/Build/Common/Version.props

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,21 @@
3636
ROSLYN.UTILITIES (Runtime package)
3737
═══════════════════════════════════════════════════════════════════════ -->
3838
<PropertyGroup Label="Roslyn.Utilities">
39-
<ANcpLuaRoslynUtilitiesVersion>1.39.0</ANcpLuaRoslynUtilitiesVersion>
39+
<ANcpLuaRoslynUtilitiesVersion>1.40.0</ANcpLuaRoslynUtilitiesVersion>
4040
</PropertyGroup>
4141

4242
<!-- ═══════════════════════════════════════════════════════════════════════
4343
ROSLYN.UTILITIES.SOURCES (Source-only package for generators)
4444
═══════════════════════════════════════════════════════════════════════ -->
4545
<PropertyGroup Label="Roslyn.Utilities.Sources">
46-
<ANcpLuaRoslynUtilitiesSourcesVersion>1.39.0</ANcpLuaRoslynUtilitiesSourcesVersion>
46+
<ANcpLuaRoslynUtilitiesSourcesVersion>1.40.0</ANcpLuaRoslynUtilitiesSourcesVersion>
4747
</PropertyGroup>
4848

4949
<!-- ═══════════════════════════════════════════════════════════════════════
5050
ROSLYN.UTILITIES.POLYFILLS (Source-only polyfills for netstandard2.0)
5151
═══════════════════════════════════════════════════════════════════════ -->
5252
<PropertyGroup Label="Roslyn.Utilities.Polyfills">
53-
<ANcpLuaRoslynUtilitiesPolyfillsVersion>1.39.0</ANcpLuaRoslynUtilitiesPolyfillsVersion>
53+
<ANcpLuaRoslynUtilitiesPolyfillsVersion>1.40.0</ANcpLuaRoslynUtilitiesPolyfillsVersion>
5454
</PropertyGroup>
5555

5656
<!-- ═══════════════════════════════════════════════════════════════════════
@@ -82,11 +82,11 @@
8282
═══════════════════════════════════════════════════════════════════════ -->
8383
<PropertyGroup Label="Meziantou">
8484
<MeziantouFrameworkVersion>5.0.12</MeziantouFrameworkVersion>
85-
<MeziantouFullPathVersion>1.1.15</MeziantouFullPathVersion>
86-
<MeziantouTemporaryDirectoryVersion>1.0.34</MeziantouTemporaryDirectoryVersion>
85+
<MeziantouFullPathVersion>1.1.16</MeziantouFullPathVersion>
86+
<MeziantouTemporaryDirectoryVersion>1.0.35</MeziantouTemporaryDirectoryVersion>
8787
<MeziantouThreadingVersion>2.0.4</MeziantouThreadingVersion>
8888
<MeziantouDependencyScanningVersion>2.0.7</MeziantouDependencyScanningVersion>
89-
<MeziantouAnalyzerVersion>2.0.301</MeziantouAnalyzerVersion>
89+
<MeziantouAnalyzerVersion>3.0.17</MeziantouAnalyzerVersion>
9090
</PropertyGroup>
9191

9292
<!-- ═══════════════════════════════════════════════════════════════════════
@@ -95,7 +95,7 @@
9595
═══════════════════════════════════════════════════════════════════════ -->
9696
<PropertyGroup Label="Testing">
9797
<XunitV3Version>3.2.2</XunitV3Version>
98-
<AwesomeAssertionsVersion>9.3.0</AwesomeAssertionsVersion>
98+
<AwesomeAssertionsVersion>9.4.0</AwesomeAssertionsVersion>
9999
<AwesomeAssertionsAnalyzersVersion>9.0.8</AwesomeAssertionsAnalyzersVersion>
100100
</PropertyGroup>
101101

@@ -106,7 +106,7 @@
106106
<PropertyGroup Label="MTP Extensions">
107107
<MTPExtensionsVersion>2.1.0</MTPExtensionsVersion>
108108
<CodeCoverageVersion>18.4.1</CodeCoverageVersion>
109-
<TestSdkVersion>18.0.1</TestSdkVersion>
109+
<TestSdkVersion>18.3.0</TestSdkVersion>
110110
<DiagnosticsTestingVersion>10.3.0</DiagnosticsTestingVersion>
111111
<GitHubActionsLoggerMTPVersion>3.0.1</GitHubActionsLoggerMTPVersion>
112112
<GitHubActionsLoggerVSTestVersion>2.4.1</GitHubActionsLoggerVSTestVersion>
@@ -116,7 +116,7 @@
116116
ANALYZERS (SDK-injected)
117117
═══════════════════════════════════════════════════════════════════════ -->
118118
<PropertyGroup Label="Analyzers">
119-
<ANcpLuaAnalyzersVersion>1.19.1</ANcpLuaAnalyzersVersion>
119+
<ANcpLuaAnalyzersVersion>1.19.4</ANcpLuaAnalyzersVersion>
120120
<SbomTargetsVersion>4.1.5</SbomTargetsVersion>
121121
<BannedApiAnalyzersVersion>4.14.0</BannedApiAnalyzersVersion>
122122
<JonSkeetAnalyzersVersion>1.0.0-beta.6</JonSkeetAnalyzersVersion>
@@ -154,10 +154,10 @@
154154
<!-- ═══════════════════════════════════════════════════════════════════════
155155
OPENAPI / YAML
156156
Used by: SDK (OpenAPI tooling)
157-
Note: OpenApi.Readers 2.0.0 stable doesn't exist, using preview
157+
Note: OpenApi.Readers stable 2.0+ doesn't exist, still on preview
158158
═══════════════════════════════════════════════════════════════════════ -->
159159
<PropertyGroup Label="OpenAPI">
160-
<MicrosoftOpenApiVersion>2.0.0</MicrosoftOpenApiVersion>
160+
<MicrosoftOpenApiVersion>3.3.1</MicrosoftOpenApiVersion>
161161
<MicrosoftOpenApiReadersVersion>2.0.0-preview.13</MicrosoftOpenApiReadersVersion>
162162
<YamlDotNetVersion>16.3.0</YamlDotNetVersion>
163163
</PropertyGroup>

tests/ANcpLua.Sdk.Tests/CLAUDE.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ dotnet test --project tests/ANcpLua.Sdk.Tests/ANcpLua.Sdk.Tests.csproj --filter-
2323
Tests use `ProjectBuilder` to create isolated .NET projects and validate SDK behavior:
2424

2525
```csharp
26-
await using var project = CreateProjectBuilder();
27-
project.AddCsprojFile([("OutputType", "Library")]);
28-
project.AddFile("sample.cs", "public class Sample { }");
29-
var result = await project.BuildAsync();
26+
await using var project = SdkProjectBuilder.Create(fixture);
27+
var result = await project
28+
.WithOutputType("Library")
29+
.AddSource("sample.cs", "public class Sample { }")
30+
.BuildAsync();
3031
result.AssertSuccess();
3132
```
3233

@@ -97,14 +98,11 @@ Example:
9798
[Fact]
9899
public async Task NewFeature_WhenEnabled_ShouldWork()
99100
{
100-
await using var project = CreateProjectBuilder();
101-
project.AddCsprojFile([
102-
("TargetFramework", "net10.0"),
103-
("NewFeature", "true")
104-
]);
105-
project.AddFile("test.cs", "public class Test { }");
106-
107-
var result = await project.BuildAsync();
101+
await using var project = SdkProjectBuilder.Create(fixture);
102+
var result = await project
103+
.WithProperty("NewFeature", "true")
104+
.AddSource("test.cs", "public class Test { }")
105+
.BuildAsync();
108106

109107
result.AssertSuccess();
110108
result.AssertPropertyValue("NewFeature", "true");

tests/ANcpLua.Sdk.Tests/Helpers/SdkProjectBuilder.cs

Lines changed: 0 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -389,110 +389,6 @@ protected override void GenerateCsprojFile()
389389
private string GetSdkElementContent(string sdkName) =>
390390
$"""<Sdk Name="{sdkName}" Version="{_fixture.Version}" />""";
391391

392-
#region Backward compatibility - deprecated methods
393-
394-
/// <summary>
395-
/// Adds a csproj file with SDK-specific configuration.
396-
/// </summary>
397-
/// <remarks>
398-
/// This method is deprecated. Prefer using the fluent API:
399-
/// <code>
400-
/// await using var project = SdkProjectBuilder.Create(fixture);
401-
/// var result = await project
402-
/// .WithTargetFramework(Tfm.Net100)
403-
/// .AddSource("Code.cs", code)
404-
/// .BuildAsync();
405-
/// </code>
406-
/// </remarks>
407-
[Obsolete("Use fluent API: SdkProjectBuilder.Create(fixture).WithTargetFramework().AddSource().BuildAsync()")]
408-
public SdkProjectBuilder AddCsprojFile(
409-
(string Name, string Value)[]? properties = null,
410-
NuGetReference[]? nuGetPackages = null,
411-
IEnumerable<XElement>? additionalProjectElements = null,
412-
string? sdk = null,
413-
string? rootSdk = null,
414-
string filename = "ANcpLua.TestProject.csproj",
415-
SdkImportStyle importStyle = SdkImportStyle.Default)
416-
{
417-
// Migrate parameters to fluent state
418-
if (properties is not null)
419-
foreach (var prop in properties)
420-
WithProperty(prop.Name, prop.Value);
421-
422-
if (nuGetPackages is not null)
423-
foreach (var pkg in nuGetPackages)
424-
WithPackage(pkg.Name, pkg.Version);
425-
426-
if (additionalProjectElements is not null)
427-
foreach (var element in additionalProjectElements)
428-
_additionalProjectElements.Add(element);
429-
430-
if (sdk is not null) _sdkName = sdk;
431-
if (rootSdk is not null) RootSdk = rootSdk;
432-
if (filename != "ANcpLua.TestProject.csproj") WithFilename(filename);
433-
if (importStyle != SdkImportStyle.Default) _sdkImportStyle = importStyle;
434-
435-
// Generate immediately for backward compatibility
436-
GenerateCsprojFile();
437-
return this;
438-
}
439-
440-
/// <summary>
441-
/// Sets the .NET SDK version (alias for WithDotnetSdkVersion for backward compatibility).
442-
/// </summary>
443-
public void SetDotnetSdkVersion(NetSdkVersion version) => WithDotnetSdkVersion(version);
444-
445-
/// <summary>
446-
/// Builds the project (alias for BuildAsync for backward compatibility).
447-
/// </summary>
448-
public Task<BuildResult> BuildAndGetOutput(
449-
string[]? buildArguments = null,
450-
(string Name, string Value)[]? environmentVariables = null) =>
451-
ExecuteDotnetCommandAsync("build", buildArguments, environmentVariables);
452-
453-
/// <summary>
454-
/// Packs the project (alias for PackAsync for backward compatibility).
455-
/// </summary>
456-
public Task<BuildResult> PackAndGetOutput(
457-
string[]? packArguments = null,
458-
(string Name, string Value)[]? environmentVariables = null) =>
459-
ExecuteDotnetCommandAsync("pack", packArguments, environmentVariables);
460-
461-
/// <summary>
462-
/// Runs tests (alias for TestAsync for backward compatibility).
463-
/// </summary>
464-
public Task<BuildResult> TestAndGetOutput(
465-
string[]? testArguments = null,
466-
(string Name, string Value)[]? environmentVariables = null) =>
467-
ExecuteDotnetCommandAsync("test", testArguments, environmentVariables);
468-
469-
/// <summary>
470-
/// Runs the project (alias for RunAsync for backward compatibility).
471-
/// </summary>
472-
public Task<BuildResult> RunAndGetOutput(
473-
string[]? arguments = null,
474-
(string Name, string Value)[]? environmentVariables = null) =>
475-
ExecuteDotnetCommandAsync("run", ["--", .. arguments ?? []], environmentVariables);
476-
477-
/// <summary>
478-
/// Restores the project (alias for RestoreAsync for backward compatibility).
479-
/// </summary>
480-
public Task<BuildResult> RestoreAndGetOutput(
481-
string[]? arguments = null,
482-
(string Name, string Value)[]? environmentVariables = null) =>
483-
ExecuteDotnetCommandAsync("restore", arguments, environmentVariables);
484-
485-
/// <summary>
486-
/// Executes an arbitrary dotnet command (alias for ExecuteDotnetCommandAsync for backward compatibility).
487-
/// </summary>
488-
public Task<BuildResult> ExecuteDotnetCommandAndGetOutput(
489-
string command,
490-
string[]? arguments = null,
491-
(string Name, string Value)[]? environmentVariables = null) =>
492-
ExecuteDotnetCommandAsync(command, arguments, environmentVariables);
493-
494-
#endregion
495-
496392
/// <inheritdoc />
497393
public override async Task<BuildResult> ExecuteDotnetCommandAsync(
498394
string command,

0 commit comments

Comments
 (0)