dotnet / dotnet/templating

Create a host symbol for host RID (or RID components) for use in templates

Open
#8,307 3 comments 0 reactions 0 assignees View on GitHub
triage:transfer-to-sdk
Dominant language
No language data
Stars
1.7k
Forks
399
Avg merge
3d 5h
Merged PRs (30d)
39

Description

### Is your feature request related to a problem? Please describe.

Today we provide the following [Host-provided symbols for binding](https://github.com/dotnet/templating/blob/cd68572c1c42b81dfb6c1f81b731e2b3b95752b0/src/Microsoft.TemplateEngine.Edge/DefaultTemplateEngineHost.cs#L59-L67):

* HostIdentifier
* WorkingDirectory

We should make it easier for template authors to create per-architecture defaults/options by providing the current host RID as another symbol/bindable value.

### Describe the solution you'd like.

We should provide two new symbols to allow template authors to condition code/assets/symbols/etc based on host OS and host architecture.

* HostPlatform // e.g. win, macos, linux - the first part of the RID. May be dynamic because it is powered by the RID graph.
* HostArchitecture // eg. x64, arm64, x85 - the second logical part of the RID. May be dynamic because it is powered by the RID graph.

### Additional context

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.