Add net10.0 target framework#379
Merged
Merged
Conversation
Multi-target the library and tests to net8.0 and net10.0. The source generator analyzer is TFM-independent, so it is packed only once. CI installs both SDKs since running tests for the net8.0 target requires the .NET 8 runtime. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Multi-targets Sharprompt and its test suite for net8.0 and net10.0, ensuring builds/tests run on both runtimes while avoiding duplicate analyzer packing during dotnet pack.
Changes:
- Multi-targeted library and test projects to
net8.0;net10.0. - Conditioned
_PackSourceGeneratorso the analyzer is packed only once when multi-targeting. - Updated GitHub Actions workflows to install both .NET SDK 8.0.x and 10.0.x.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/Sharprompt.Tests/Sharprompt.Tests.csproj | Multi-targets the test project for net8.0 + net10.0. |
| src/Sharprompt/Sharprompt.csproj | Multi-targets the library and adjusts analyzer packing for multi-target builds. |
| .github/workflows/build.yml | Installs both .NET 8 and .NET 10 SDKs for CI build/test/lint. |
| .github/workflows/publish.yml | Installs both .NET 8 and .NET 10 SDKs for packing/publishing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Avoid hard-coding net8.0 so the analyzer keeps being packed if the TargetFrameworks list changes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Multi-targets the library and test project to net8.0 + net10.0.
Sharprompt.csproj/Sharprompt.Tests.csproj:<TargetFrameworks>net8.0;net10.0</TargetFrameworks>— the full test suite now runs on both runtimes._PackSourceGeneratortarget is TFM-independent, so it is now conditioned to pack the analyzer only once (previously it would be added per-TFM, producing duplicate-file pack warnings).build.yml/publish.yml: install both the 8.0.x and 10.0.x SDKs (running the net8.0 test target requires the .NET 8 runtime;DOTNET_VERSIONenv replaced by an inline version list).Verification
dotnet pack: package containslib/net8.0,lib/net10.0(with satellite resources), andanalyzers/dotnet/csexactly once — no pack warningsdotnet formatclean🤖 Generated with Claude Code