Open gtbuchanan opened 5 years ago
Hi @gtbuchanan,
I don't actually think i've ever used the functionality in visual studio so am not entirely sure what it'd be used for. What would you like the file to be transformed in to, a .cs
file? If so i'd probably recommend Scripty over this since it's a much more fully featured tool. I'd be interested in hearing your ideas though.
@Romanx With T4, the generator functionality is used to automatically create the resulting file when the template is saved in Visual Studio. However, T4 has a built-in construct for defining the output file extension:
<#@ output extension=".cs" #>
After thinking about it a little longer, the following would be required for this to work:
Glyphicons.cs.mustache
Glyphicons.json
I was not aware of Scripty. Considering these things, you might be right about Scripty being a better choice. Though there is a current issue about 3rd party references being a pain.
It's possible to have Visual Studio generate a file on save of another file using a Single File Generator. T4 templates use the built-in
TextTemplatingFileGenerator
, but I believe other custom generators can be installed by a Visual Studio Extension.It'd be great to have this functionality with Mustache templates as well.
Getting it working on .NET Standard