dotnet / dotnet/arcade

GenerateFileFromTemplate: allow a user-specified variable prefix string

Open
#14,552 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
729
Forks
397
Avg merge
3d 15m
Merged PRs (30d)
149

Description

- [ ] This issue is blocking
- [ ] This issue is causing unreasonable pain

I am using the `GenerateFileFromTemplate` task to create a CMake config file for a NativeAOT library in order to make it easy for downstream projects to consume my native binary. CMake uses `${Foo}` syntax for writing variables. As a result my cmake template.in file looks like this:

```cmake
set_property(TARGET "${libArtifactName}::libs" PROPERTY IMPORTED_LOCATION "`${LIBBASEPATH}/`${NAME}`${EXT}")
```

here `libArtifactName` is a `GenerateFileFromTemplate` parameter, and `` `${NAME} `` is a cmake variable.

It would be nice if I could specify a custom sigil for template variables:

```xml

```

Then my template could look like this:

```cmake
set_property(TARGET "£{libArtifactName}::libs" PROPERTY IMPORTED_LOCATION "${LIBBASEPATH}/${NAME}${EXT}")
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.