Skip to content

[templates] Use DOTNET_TFM placeholder and add TFM update script#25913

Draft
rolfbjarne wants to merge 2 commits into
mainfrom
dev/rolf/template-tfm-updates
Draft

[templates] Use DOTNET_TFM placeholder and add TFM update script#25913
rolfbjarne wants to merge 2 commits into
mainfrom
dev/rolf/template-tfm-updates

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

The template engine's replaces field and the <TargetFramework> in project files now use the
fixed placeholder DOTNET_TFM instead of a literal TFM like net10.0-ios. This means those
values 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_TFM
from Make.config and computes whether to include the previous TFM as an option based on the
support policy: the previous TFM is offered until May 15th of the year after the current major
.NET version was released.

The script:

  • Preserves file formatting (BOM, indentation, trailing newlines)
  • Is idempotent (safe to run repeatedly)
  • Requires only bash 3.2+ and python3

🤖 Pull request created by Copilot

rolfbjarne and others added 2 commits July 2, 2026 14:49
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>
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #78cfbdb] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 78cfbdb54b990e4c6cb1b8ae6db38d24776f4cf1 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #78cfbdb] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 78cfbdb54b990e4c6cb1b8ae6db38d24776f4cf1 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 78cfbdb54b990e4c6cb1b8ae6db38d24776f4cf1 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #78cfbdb] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 78cfbdb54b990e4c6cb1b8ae6db38d24776f4cf1 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [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
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 17 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 18 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Ventura (13): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: 78cfbdb54b990e4c6cb1b8ae6db38d24776f4cf1 [PR build]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants