T4.SourceGenerator 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package T4.SourceGenerator --version 1.0.0                
NuGet\Install-Package T4.SourceGenerator -Version 1.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="T4.SourceGenerator" Version="1.0.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add T4.SourceGenerator --version 1.0.0                
#r "nuget: T4.SourceGenerator, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install T4.SourceGenerator as a Cake Addin
#addin nuget:?package=T4.SourceGenerator&version=1.0.0

// Install T4.SourceGenerator as a Cake Tool
#tool nuget:?package=T4.SourceGenerator&version=1.0.0                

<a href="https://www.buymeacoffee.com/cptwesley" target="_blank"><img src="https://shields.io/badge/Support%20Me-Buy%20Me%20A%20Coffee-yellow?style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAgCAYAAAAWl4iLAAAGBnpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjarVdbkuQqDv1nFbMEQAjBcngpYnYwy58jjF2ZVdl9+84dO9JgLPQ6epBu/eff6v6FK4YQXWIpuebscaWaamyYFH9d1xh82s/rJZ9v4X3dxbPuI5YII12veR36hnX+2iDprPf3dSfj8CmHUXgY74tMss0PXTmMKF7r4by7eva19GLO+cVx2B7m39+TwBmTwY+ii4sCeTyTSSH7BWr42RP6xHuF8dYwj59957r/7Lxn9s13vp11eneF8zcK+ZuPznrgb+v0iIlvGoUvyW8fEAbiX68X36nOorou61rK8FR2x6jblD0DISxOtLdl3IIfYy77rrgLTBxAbALNjnu4UEOEtzWkMEMLGtYeRxhQMcUVBWOMAx63tUISaxwGAyW7g0ahStNRARIDqBGW46NL2HLrljdCgeQZQIlkGJAb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sB+0kFREB5RACbRABbRAQ1gpIZL9tvkQKbZ8H7wyzyie3Zk9tCAOMDppkgghOVzfUUoYCwAXqS8LH7a3+3fVGQvJ4SIefXJSguQqKwKjk94ng9qi+ZQMhj9Q11rCLVHTY7G87YKWYujlOVL8PY3qsq7LmtMxaDF1XVvQTmxosSsonR5JSygkR3+IERwziY90CDZhDGMror/18UHsJtaEPFtNnEEsJb93tYKd51fpKIc9hr51Kx7m+MIP/XP0sXtt5p5aoTWL2mszi/hHrmKnQEjRFxqSbKOQh5B1AAAAAElFTkSuQmCC" alt="Buy Me A Coffee" ></a>
License: MIT
NuGetNuGet

<img src="https://raw.githubusercontent.com/CptWesley/T4.SourceGenerator/master/logo_1024x1024.png" width="178" height="178">

T4.SourceGenerator

Modern Roslyn Source Generator for T4 templates, which transforms T4 templates during compilation using the mono T4 templating engine (Mono.TextTemplating). This means that C#11 features are available to be used in your T4 templates.

Installing

Through NuGet wizard

Look for the T4.SourceGenerator on NuGet and install the package.

With PowerShell

To install the package through PowerShell, use the following command:

Install-Package DT4.SourceGenerator

Manual installation

To install the package manually, include the following snippet in your .csproj file:

<Project Sdk="Microsoft.NET.Sdk">

  <ItemGroup>
    <PackageReference Include="T4.SourceGenerator" Version="1.0.0" PrivateAssets="all" />
  </ItemGroup>

</Project>

Usage

After installing the package, add your T4 templates with .tt or .t4 extensions to your project. Adding your template files might add some items to your .csproj file that look like this (for Bar.tt):

<Project Sdk="Microsoft.NET.Sdk">

  <ItemGroup>
    <None Remove="templates\Bar.tt" />
  </ItemGroup>

  <ItemGroup>
    <AdditionalFiles Update="Templates\Bar.tt">
      <Generator>TextTemplatingFileGenerator</Generator>
    </AdditionalFiles>
  </ItemGroup>

  <ItemGroup>
    <Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
  </ItemGroup>

</Project>

These entries are used by the regular T4 template engine and are not necessary (and will most likely lead to conflicts) with the code generation provided by this package. Thus these lines should be removed.

Instead, your templates should be included in your .csproj as AdditionalFiles as such (for Bar.tt):

<Project Sdk="Microsoft.NET.Sdk">

  <ItemGroup>
    <AdditionalFiles Include="Bar.tt" />
  </ItemGroup>

</Project>

Licensing

The source code is fully MIT licensed.

Contribution

Any help is welcome. Feel free to open issues or feature requests or create a pull request.

Support Me

Want to support me in other ways? You can buy me a coffee! But don't feel obliged to!

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.3.1 88 10/3/2024
1.3.0 76 10/3/2024
1.2.0 3,149 11/16/2023
1.1.0 147 11/15/2023
1.0.0 432 11/3/2023

### v1.0.0
     - Initial version