Skip to content

Commit 8a53aed

Browse files
committed
Updated version number to 1.2.0
1 parent de80b85 commit 8a53aed

18 files changed

+39
-38
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2020 RdJNL
1+
Copyright 2022 RdJNL
22
All rights reserved
33

44
Latest revision: 19 March 2020

README.md

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
# T4 Text Templating with .NET 5
2-
The software in this repository allows you to run a T4 template with the .NET 5 runtime. This means you can load .NET Core and .NET 5 assemblies and use .NET 5 libraries. My team uses it to generate C# code for types in a .NET Core 3.1 assembly (using Reflection). We also use it to process a JSON file using .NET 5's System.Text.Json library.
1+
# T4 Text Templating with .NET 6
2+
The software in this repository allows you to run a T4 template with the .NET 6 runtime. This means you can load .NET Core and .NET 5/6 assemblies and use .NET 6 libraries. My team uses it to generate C# code for types in a .NET Core 3.1 assembly (using Reflection). We also use it to process a JSON file using .NET 6's System.Text.Json library.
33

44
__Author:__ RdJNL
55

66
## Latest release
7-
Version 1.1.1 can be downloaded [here](https://github.com/RdJNL/TextTemplatingCore/releases/download/v1.1.1/TextTemplatingCore_v1.1.1.zip).
7+
Version 1.2.0 can be downloaded [here](https://github.com/RdJNL/TextTemplatingCore/releases/download/v1.2.0/TextTemplatingCore_v1.2.0.zip).
88

99
## Requirements
10-
- .NET 5
10+
- .NET 6
1111
- .NET Framework 4.8
12-
- Visual Studio 2019 (for the VS extension)
12+
- Visual Studio 2019/2022 (for the VS extension)
1313

1414
## How to use it
1515

16-
### Visual Studio 2019 extension
16+
### Visual Studio 2019/2022 extension
1717
- The extension is provided as a VSIX file. Run this file to install the extension to Visual Studio. You may need to use an elevated command prompt to run the file as admin.
1818
- Once the extension is installed, open your solution in Visual Studio.
1919
- Select the `.tt` file in the Solution Explorer, right click it and click properties.
@@ -23,21 +23,23 @@ Version 1.1.1 can be downloaded [here](https://github.com/RdJNL/TextTemplatingCo
2323
### TextTransformCore executable
2424
To use the executable, simply run it from the command line. Provide as first and only argument the path to the template file. If the path has spaces in it, makes sure to surround it with double quotes (`"`).
2525

26-
## Limitations
26+
## Differences with Visual Studio's T4 processor
2727
There are several limitations to this approach:
2828
- The hostspecific setting __must__ be false.
2929
- No debugging.
3030
- No template parameters.
3131
- The VS extension cannot be used in database projects (this seems to be a bug in Visual Studio).
3232

33-
## Extra feature
3433
This processor has one feature that Visual Studio's processor does not have:
3534
- From a T4 template, you can access the `TemplateFile` string property to get the absolute path to the template file.
3635

36+
There is one other difference with Visual Studio's processor:
37+
- When running a template using the VS extension, relative paths in assembly directives are relative to the T4 template file, rather than to the solution directory. To provide a path relative to the solution directory, use the `$(SolutionDir)` environment variable.
38+
3739
## How does it work?
3840
The following steps are followed to process the T4 template:
3941
- .NET Framework 4.8 code (either the VS extension or the TextTransformCore executable) uses Visual Studio's T4 template processor to preprocess the template into C# code. This C# code is saved to a temporary file.
40-
- The .NET Framework code runs a .NET 5 executable which compiles the C# code and runs it. The result is once again saved to a temporary file.
42+
- The .NET Framework code runs a .NET 6 executable which compiles the C# code and runs it. The result is once again saved to a temporary file.
4143
- The .NET Framework code loads the content of the temporary file and either passes it to Visual Studio (the VS extension) or saves it to the output file (the TextTransformCore executable).
4244

4345
## License

TemplateExecute/LibraryLoadContext.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//---------------------------------------------//
2-
// Copyright 2020 RdJNL //
2+
// Copyright 2022 RdJNL //
33
// https://github.com/RdJNL/TextTemplatingCore //
44
//---------------------------------------------//
55
using System;

TemplateExecute/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//---------------------------------------------//
2-
// Copyright 2020 RdJNL //
2+
// Copyright 2022 RdJNL //
33
// https://github.com/RdJNL/TextTemplatingCore //
44
//---------------------------------------------//
55
using System;

TemplateExecute/TemplateExecute.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<Authors>RdJNL</Authors>
1010
<Company>RdJNL</Company>
1111
<Product>TemplateExecute</Product>
12-
<Copyright>Copyright 2020 RdJNL</Copyright>
12+
<Copyright>Copyright 2022 RdJNL</Copyright>
1313
</PropertyGroup>
1414

1515
<ItemGroup>

TextTemplatingCoreLib/TemplateError.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//---------------------------------------------//
2-
// Copyright 2020 RdJNL //
2+
// Copyright 2022 RdJNL //
33
// https://github.com/RdJNL/TextTemplatingCore //
44
//---------------------------------------------//
55
namespace RdJNL.TextTemplatingCore.TextTemplatingCoreLib

TextTemplatingCoreLib/TemplateException.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//---------------------------------------------//
2-
// Copyright 2020 RdJNL //
2+
// Copyright 2022 RdJNL //
33
// https://github.com/RdJNL/TextTemplatingCore //
44
//---------------------------------------------//
55
using System;

TextTemplatingCoreLib/TextTemplatingCoreLib.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<Authors>RdJNL</Authors>
88
<Company>RdJNL</Company>
99
<Product>TextTemplatingCoreLib</Product>
10-
<Copyright>Copyright 2020 RdJNL</Copyright>
10+
<Copyright>Copyright 2022 RdJNL</Copyright>
1111
</PropertyGroup>
1212

1313
<ItemGroup>

TextTemplatingCoreLib/TextTemplatingHelper.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//---------------------------------------------//
2-
// Copyright 2020 RdJNL //
2+
// Copyright 2022 RdJNL //
33
// https://github.com/RdJNL/TextTemplatingCore //
44
//---------------------------------------------//
55
using System;

TextTemplatingFileGeneratorCore/LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2020 RdJNL
1+
Copyright 2022 RdJNL
22
All rights reserved
33

44
More information about this application is available at https://github.com/RdJNL/TextTemplatingCore.

TextTemplatingFileGeneratorCore/Properties/AssemblyInfo.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[assembly: AssemblyConfiguration("")]
1111
[assembly: AssemblyCompany("RdJNL")]
1212
[assembly: AssemblyProduct("TextTemplatingFileGeneratorCore")]
13-
[assembly: AssemblyCopyright("Copyright 2020 RdJNL")]
13+
[assembly: AssemblyCopyright("Copyright 2022 RdJNL")]
1414
[assembly: AssemblyTrademark("")]
1515
[assembly: AssemblyCulture("")]
1616

@@ -29,5 +29,5 @@
2929
// You can specify all the values or you can default the Build and Revision Numbers
3030
// by using the '*' as shown below:
3131
// [assembly: AssemblyVersion("1.0.*")]
32-
[assembly: AssemblyVersion("1.1.1.0")]
33-
[assembly: AssemblyFileVersion("1.1.1.0")]
32+
[assembly: AssemblyVersion("1.2.0.0")]
33+
[assembly: AssemblyFileVersion("1.2.0.0")]

TextTemplatingFileGeneratorCore/TextTemplatingFileGeneratorCore.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//---------------------------------------------//
2-
// Copyright 2020 RdJNL //
2+
// Copyright 2022 RdJNL //
33
// https://github.com/RdJNL/TextTemplatingCore //
44
//---------------------------------------------//
55
using System;
@@ -23,7 +23,7 @@ public sealed class TextTemplatingFileGeneratorCore : BaseTemplatedCodeGenerator
2323
{
2424
public const string GENERATOR_GUID = "85B769DE-38F5-4CBE-91AE-D0DFA431FE30";
2525
public const string GENERATOR_NAME = nameof(TextTemplatingFileGeneratorCore);
26-
public const string GENERATOR_DESCRIPTION = "Generate files from T4 templates using the .NET 5 runtime.";
26+
public const string GENERATOR_DESCRIPTION = "Generate files from T4 templates using the .NET 6 runtime.";
2727

2828
private const string ERROR_OUTPUT = "ErrorGeneratingOutput";
2929
private const string TEMPLATE_NAMESPACE = "RdJNL.TextTemplatingCore.GeneratedTemplate";

TextTemplatingFileGeneratorCore/VSPackage.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//---------------------------------------------//
2-
// Copyright 2020 RdJNL //
2+
// Copyright 2022 RdJNL //
33
// https://github.com/RdJNL/TextTemplatingCore //
44
//---------------------------------------------//
55
using System;
@@ -18,9 +18,9 @@ namespace RdJNL.TextTemplatingCore.TextTemplatingFileGeneratorCore
1818
public sealed class VSPackage : AsyncPackage
1919
{
2020
public const string PACKAGE_GUID = "68C949A0-7E31-4336-82A1-DBAEFCD2AE62";
21-
public const string PACKAGE_NAME = "Text Templating File Generator .NET 5";
21+
public const string PACKAGE_NAME = "Text Templating File Generator .NET 6";
2222
public const string PACKAGE_DESCRIPTION = TextTemplatingFileGeneratorCore.GENERATOR_DESCRIPTION;
23-
public const string PACKAGE_VERSION = "1.1.1";
23+
public const string PACKAGE_VERSION = "1.2.0";
2424

2525
protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress)
2626
{

TextTemplatingFileGeneratorCore/source.extension.vsixmanifest

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
33
<Metadata>
4-
<Identity Id="RdJNL.TextTemplatingCore.Generator.85b769de-38f5-4cbe-91ae-d0dfa431fe30" Version="1.1.1" Language="en-US" Publisher="RdJNL" />
5-
<DisplayName>Text Templating File Generator .NET 5</DisplayName>
6-
<Description xml:space="preserve">Generate files from T4 templates using the .NET 5 runtime.</Description>
4+
<Identity Id="RdJNL.TextTemplatingCore.Generator.85b769de-38f5-4cbe-91ae-d0dfa431fe30" Version="1.2.0" Language="en-US" Publisher="RdJNL" />
5+
<DisplayName>Text Templating File Generator .NET 6</DisplayName>
6+
<Description xml:space="preserve">Generate files from T4 templates using the .NET 6 runtime.</Description>
77
<License>LICENSE</License>
88
</Metadata>
99
<Installation>
@@ -27,11 +27,10 @@
2727
</InstallationTarget>
2828
</Installation>
2929
<Dependencies>
30-
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />
31-
<Dependency Id="Microsoft.VisualStudio.MPF.16.0" DisplayName="Visual Studio MPF 16.0" d:Source="Installed" Version="[16.0,17.0)" />
30+
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.8,)" />
3231
</Dependencies>
3332
<Prerequisites>
34-
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[16.0,17.0)" DisplayName="Visual Studio core editor" />
33+
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[16.0,)" DisplayName="Visual Studio core editor" />
3534
</Prerequisites>
3635
<Assets>
3736
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />

TextTransformCore/ExtensionException.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//---------------------------------------------//
2-
// Copyright 2020 RdJNL //
2+
// Copyright 2022 RdJNL //
33
// https://github.com/RdJNL/TextTemplatingCore //
44
//---------------------------------------------//
55
using System;

TextTransformCore/LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2020 RdJNL
1+
Copyright 2022 RdJNL
22
All rights reserved
33

44
More information about this application is available at https://github.com/RdJNL/TextTemplatingCore.

TextTransformCore/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//---------------------------------------------//
2-
// Copyright 2020 RdJNL //
2+
// Copyright 2022 RdJNL //
33
// https://github.com/RdJNL/TextTemplatingCore //
44
//---------------------------------------------//
55
using System;

TextTransformCore/Properties/AssemblyInfo.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[assembly: AssemblyConfiguration("")]
1111
[assembly: AssemblyCompany("RdJNL")]
1212
[assembly: AssemblyProduct("TextTransformCore")]
13-
[assembly: AssemblyCopyright("Copyright 2020 RdJNL")]
13+
[assembly: AssemblyCopyright("Copyright 2022 RdJNL")]
1414
[assembly: AssemblyTrademark("")]
1515
[assembly: AssemblyCulture("")]
1616

@@ -29,5 +29,5 @@
2929
// You can specify all the values or you can default the Build and Revision Numbers
3030
// by using the '*' as shown below:
3131
// [assembly: AssemblyVersion("1.0.*")]
32-
[assembly: AssemblyVersion("1.1.1.0")]
33-
[assembly: AssemblyFileVersion("1.1.1.0")]
32+
[assembly: AssemblyVersion("1.2.0.0")]
33+
[assembly: AssemblyFileVersion("1.2.0.0")]

0 commit comments

Comments
 (0)