[templates] Use DOTNET_TFM placeholder and add TFM update script#25913
[templates] Use DOTNET_TFM placeholder and add TFM update script#25913rolfbjarne wants to merge 2 commits into
Conversation
Change the 'replaces' field in template.json files from the literal TFM (e.g. 'net10.0-ios') to 'DOTNET_TFM', and update the corresponding project files to use 'DOTNET_TFM' as the placeholder value. This makes it easier to update templates for new .NET versions, since the replacement token is now a fixed string rather than a version-specific value that needs to change every release. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Add dotnet/update-tfm-in-templates.sh which updates the hardcoded target framework values (choices, defaultValue, descriptions) in template.json and localize files for new .NET versions. The script: - Reads DOTNET_TFM from Make.config to determine the current version - Computes whether to include the previous TFM based on support policy: previous TFM is supported until May 15th of the year after the current major .NET version was released - Updates all template.json Framework choices and localize strings - Handles UTF-8 BOM files correctly - Is idempotent (safe to run multiple times) Also run the script to normalize the JSON formatting in the template and localize files. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #78cfbdb] Build passed (Detect API changes) ✅Pipeline on Agent |
✅ [PR Build #78cfbdb] Build passed (Build packages) ✅Pipeline on Agent |
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
✅ [PR Build #78cfbdb] Build passed (Build macOS tests) ✅Pipeline on Agent |
🚀 [CI Build #78cfbdb] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 199 tests passed 🎉 Tests counts✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
The template engine's
replacesfield and the<TargetFramework>in project files now use thefixed placeholder
DOTNET_TFMinstead of a literal TFM likenet10.0-ios. This means thosevalues no longer need manual updates when bumping to a new .NET version.
A new script (
dotnet/update-tfm-in-templates.sh) handles the remaining version-specific values(choices, defaultValue, descriptions in template.json and localize files). It reads
DOTNET_TFMfrom
Make.configand computes whether to include the previous TFM as an option based on thesupport policy: the previous TFM is offered until May 15th of the year after the current major
.NET version was released.
The script:
🤖 Pull request created by Copilot