Skip to content

Commit

Permalink
17.0: Update for VS 2022 (17.0) Preview 3.1
Browse files Browse the repository at this point in the history
Addresses Issue #4.

Tested in VS 2022.
  • Loading branch information
jazzdelightsme committed Aug 22, 2021
1 parent cc4b83c commit 04711c3
Show file tree
Hide file tree
Showing 12 changed files with 499 additions and 6 deletions.
21 changes: 17 additions & 4 deletions Package/ReadMe.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ I. Overview
The Text Template Transformation Toolkit (T4) is a powerful tool, but has to be
run manually. This package contains the files (a couple DLLs and a .targets
file) necessary to perform T4 tasks during a build. This version of the package
supports Visual Studio 2013, 2015, and 2017.
supports Visual Studio 2013 and later.

II. What to do once you've installed this package

Expand All @@ -29,7 +29,16 @@ property group.

For example, when you added the Unofficial.Microsoft.TextTemplating.BuildTasks
package, you should get a line like this added near the bottom of your msbuild
project file:
project file (new project style):

<ItemGroup>
<PackageReference Include="Unofficial.Microsoft.TextTemplating.BuildTasks" Version="17.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

OR, for previous VS versions, something like this:

<Import Project="..\packages\Unofficial.Microsoft.TextTemplating.BuildTasks.15.0.0.0\build\Unofficial.Microsoft.TextTemplating.BuildTasks.targets" Condition="Exists('..\packages\Microsoft.TextTemplating.BuildTasks.15.0.0.0\build\Unofficial.Microsoft.TextTemplating.BuildTasks.targets')" />

Expand Down Expand Up @@ -115,12 +124,10 @@ And AnotherSomething.tt might be similar, but include a different ".in" file.
Here is "FormatTemplate.t4":

<#@ assembly name="System.Core" #>
<#@ assembly name="EnvDTE" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="EnvDTE" #>
<#@ output extension=".myExt" #>
<#@ parameter type="System.String" name="SolutionDir" #>
<#@ parameter type="System.String" name="Configuration" #>
Expand Down Expand Up @@ -171,6 +178,12 @@ on package restore to pull down the
Unofficial.Microsoft.TextTemplating.BuildTasks package, you'll need to build
twice the first time you clone a new directory.

I believe previous VS versions may have required the following directives in
the example "FormatTemplate.t4" file (but I'm not sure which versions):

<#@ assembly name="EnvDTE" #>
<#@ import namespace="EnvDTE" #>

V. More information

You can find more information about T4 on MSDN and Oleg Sych's blog:
Expand Down
Binary file not shown.
480 changes: 480 additions & 0 deletions Package/build/17.0/Microsoft.TextTemplating.targets

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Package/build/17.0/Newtonsoft.Json.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions T4BuildTasks.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<metadata minClientVersion="2.8">
<id>Unofficial.Microsoft.TextTemplating.BuildTasks</id>
<title>T4 Build Tasks</title>
<version>16.9.0.0</version>
<version>17.0.0.0</version>
<authors>[email protected]</authors>
<owners>[email protected]</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<developmentDependency>true</developmentDependency>
<projectUrl>https://github.com/jazzdelightsme/UnofficialT4BuildTasks</projectUrl>
<summary>UNOFFICIAL. Contains files necessary to perform T4 tasks during a build.</summary>
<description>The Text Template Transformation Toolkit (T4) is a powerful tool, but has to be run manually. This package contains the files (a couple DLLs and a .targets file) necessary to perform T4 tasks during a build. UNOFFICIAL: This package is not produced by Microsoft/the T4 team. If you think this is useful, please encourage them to produce an official package.</description>
<releaseNotes>Added support for VS2019 16.9 preview 1. (Currently supported versions are VS2019, VS2017, VS2015, and VS2013.)</releaseNotes>
<releaseNotes>Added support for VS2022 17.0 preview 3.1. (Currently supported versions are VS2022, VS2019, VS2017, VS2015, and VS2013.)</releaseNotes>
<tags>T4 Build TextTemplating CodeGen</tags>
</metadata>
</package>

0 comments on commit 04711c3

Please sign in to comment.