Skip to content

build: retarget to .NET 10 and publish GUI/CLI as Native AOT - #1

Merged
hzqst merged 1 commit into
mainfrom
chore/net10-nativeaot
Oct 9, 2026
Merged

hzqst merged 1 commit into
mainfrom
chore/net10-nativeaot

Conversation

@hzqst

@hzqst hzqst commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Aligns BSPLocalizationTools with the organization's other .NET tools (MetahookInstaller, PR MetaHookSv/MetahookInstaller#7).

Changes

  • SDK / solution: pin the .NET 10 SDK via global.json; migrate BSPLocalizationTools.sln -> BSPLocalizationTools.slnx.
  • Targets: all projects retargeted to net10.0 / net10.0-windows10.0.17763.0.
  • Native AOT: GUI and CLI publish as Native AOT (PublishAot + full trimming); the AOT settings live in the csproj so every publish gets them, profile or not.
  • Avalonia 12: 11.3.8 -> 12.1.3, ReactiveUI.Avalonia 11.3.0 -> 12.1.6 (plus explicit System.Reactive 7.0.0, no longer transitive).
  • Avalonia 12 API: TextBox.Watermark -> PlaceholderText; dropped x:CompileBindings="False" on the map ContextMenu so its bindings compile — reflection bindings do not work under Native AOT.
  • AOT JSON: the two anonymous-type JsonSerializer.Serialize(...) calls (not AOT-compatible) are replaced with source-generated request types (LlmRequestJsonContext). Serialized JSON is byte-for-byte equivalent.
  • Cleanup: removed the redundant System.Text.Encoding.CodePages reference (in-box on .NET 10) and the unused Avalonia.Diagnostics package (removed in Avalonia 12).
  • CI / docs: build workflow moved to 10.0.x / .slnx, publishes both executables as Native AOT, prunes PDBs and asserts the exact published file set; README gained a Build section.

Verification (local, .NET SDK 10.0.401)

  • dotnet build clean: 0 warnings, 0 errors.
  • dotnet test: 85/85 pass (JSON contract assertions unchanged).
  • CLI Native AOT publish: exactly one BSPLocalizationToolsCLI.exe (~7.7 MB); parses a real BSP and builds the prompt payload before reaching the (unreachable) LLM endpoint.
  • GUI Native AOT publish: BSPLocalizationTools.exe + av_libglesv2.dll / libSkiaSharp.dll / libHarfBuzzSharp.dll + zh-CN / zh-TW satellite resources. The published GUI launches and renders correctly, with localization active (non-English) under trimming.
  • Remaining AOT output is a single third-party IL2104 summary from CsvHelper (reflection features we do not use); no warnings remain from this repository's own code.

🤖 Generated with Claude Code

Align the toolset with the organization's other .NET tools (MetahookInstaller):

- Pin the .NET 10 SDK via global.json; migrate the solution to .slnx.
- Retarget all projects to net10.0 / net10.0-windows10.0.17763.0.
- Enable Native AOT (PublishAot + full trimming) for the GUI and CLI, folding
  the AOT settings into the csproj so every publish gets them.
- Upgrade Avalonia 11.3.8 -> 12.1.3 and ReactiveUI.Avalonia 11.3.0 -> 12.1.6
  (add System.Reactive 7.0.0, which is no longer transitive).
- Adapt to Avalonia 12: TextBox.Watermark -> PlaceholderText, and drop
  x:CompileBindings="False" on the map ContextMenu so its bindings compile
  (reflection bindings break under AOT).
- Replace the two anonymous-type JsonSerializer calls with source-generated
  request types (LlmRequestJsonContext); the anonymous-type overloads are not
  AOT-compatible. JSON output is unchanged.
- Drop the redundant System.Text.Encoding.CodePages reference (in-box on
  .NET 10) and the unused Avalonia.Diagnostics package (removed in Avalonia 12).
- Update the build workflow and README for .NET 10 / Native AOT.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@hzqst
hzqst merged commit 3de530c into main Oct 9, 2026
1 check passed
@hzqst
hzqst deleted the chore/net10-nativeaot branch October 9, 2026 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant