Skip to content

Commit

Permalink
Update version to 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
RdJNL committed Dec 29, 2023
1 parent d8b271e commit 0aaf489
Show file tree
Hide file tree
Showing 18 changed files with 36 additions and 32 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2022 RdJNL
Copyright 2023 RdJNL
All rights reserved

Latest revision: 19 March 2020
Expand Down
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# T4 Text Templating with .NET 6
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.
# T4 Text Templating with .NET 8
The software in this repository allows you to run a T4 template with the .NET 8 runtime. This means you can load .NET Core and .NET 5/6/7/8 assemblies and use .NET 8 libraries. My team uses it to generate C# code for types in a .NET assembly (using Reflection). We also use it to process a JSON file using .NET's System.Text.Json library.

__Author:__ RdJNL

## Latest release
Version 1.2.0 can be downloaded [here](https://github.com/RdJNL/TextTemplatingCore/releases/download/v1.2.0/TextTemplatingCore_v1.2.0.zip).
Version 1.3.0 can be downloaded [here](https://github.com/RdJNL/TextTemplatingCore/releases/download/v1.3.0/TextTemplatingCore_v1.3.0.zip).

## Requirements
- .NET 6
- .NET 8
- .NET Framework 4.8
- Visual Studio 2019/2022 (for the VS extension)

Expand All @@ -23,7 +23,7 @@ Version 1.2.0 can be downloaded [here](https://github.com/RdJNL/TextTemplatingCo
### TextTransformCore executable
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 (`"`).

## Differences with Visual Studio's T4 processor
## Differences with Visual Studio's .NET Framework T4 processor
There are several limitations to this approach:
- The hostspecific setting __must__ be false.
- No debugging.
Expand All @@ -36,10 +36,14 @@ This processor has one feature that Visual Studio's processor does not have:
There is one other difference with Visual Studio's processor:
- 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.

## Remarks
- Microsoft has added a new T4 command line tool to Visual Studio 2022. See [this blog post](https://devblogs.microsoft.com/dotnet/t4-command-line-tool-for-dotnet/) for more information. The reactions to this tool have been mixed. Hopefully Microsoft's tool will be able to replace this project in the future.
- When using this extension, if you need the T4 template to have access to internal types/members of your assembly, add `<ItemGroup><InternalsVisibleTo Include="GeneratedTemplate.dll" /></ItemGroup>` to the project file of the assembly containing the internal types/members.

## How does it work?
The following steps are followed to process the T4 template:
- .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.
- 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.
- The .NET Framework code runs a .NET 8 executable which compiles the C# code and runs it. The result is once again saved to a temporary file.
- 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).

## License
Expand Down
2 changes: 1 addition & 1 deletion TemplateExecute/LibraryLoadContext.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//---------------------------------------------//
// Copyright 2022 RdJNL //
// Copyright 2023 RdJNL //
// https://github.com/RdJNL/TextTemplatingCore //
//---------------------------------------------//
using System;
Expand Down
2 changes: 1 addition & 1 deletion TemplateExecute/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//---------------------------------------------//
// Copyright 2022 RdJNL //
// Copyright 2023 RdJNL //
// https://github.com/RdJNL/TextTemplatingCore //
//---------------------------------------------//
using System;
Expand Down
2 changes: 1 addition & 1 deletion TemplateExecute/TemplateExecute.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Authors>RdJNL</Authors>
<Company>RdJNL</Company>
<Product>TemplateExecute</Product>
<Copyright>Copyright 2022 RdJNL</Copyright>
<Copyright>Copyright 2023 RdJNL</Copyright>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion TextTemplatingCoreLib/TemplateError.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//---------------------------------------------//
// Copyright 2022 RdJNL //
// Copyright 2023 RdJNL //
// https://github.com/RdJNL/TextTemplatingCore //
//---------------------------------------------//
namespace RdJNL.TextTemplatingCore.TextTemplatingCoreLib
Expand Down
2 changes: 1 addition & 1 deletion TextTemplatingCoreLib/TemplateException.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//---------------------------------------------//
// Copyright 2022 RdJNL //
// Copyright 2023 RdJNL //
// https://github.com/RdJNL/TextTemplatingCore //
//---------------------------------------------//
using System;
Expand Down
2 changes: 1 addition & 1 deletion TextTemplatingCoreLib/TextTemplatingCoreLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Authors>RdJNL</Authors>
<Company>RdJNL</Company>
<Product>TextTemplatingCoreLib</Product>
<Copyright>Copyright 2022 RdJNL</Copyright>
<Copyright>Copyright 2023 RdJNL</Copyright>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion TextTemplatingCoreLib/TextTemplatingHelper.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//---------------------------------------------//
// Copyright 2022 RdJNL //
// Copyright 2023 RdJNL //
// https://github.com/RdJNL/TextTemplatingCore //
//---------------------------------------------//
using System;
Expand Down
2 changes: 1 addition & 1 deletion TextTemplatingFileGeneratorCore/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2022 RdJNL
Copyright 2023 RdJNL
All rights reserved

More information about this application is available at https://github.com/RdJNL/TextTemplatingCore.
Expand Down
6 changes: 3 additions & 3 deletions TextTemplatingFileGeneratorCore/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("RdJNL")]
[assembly: AssemblyProduct("TextTemplatingFileGeneratorCore")]
[assembly: AssemblyCopyright("Copyright 2022 RdJNL")]
[assembly: AssemblyCopyright("Copyright 2023 RdJNL")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -29,5 +29,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//---------------------------------------------//
// Copyright 2022 RdJNL //
// Copyright 2023 RdJNL //
// https://github.com/RdJNL/TextTemplatingCore //
//---------------------------------------------//
using System;
Expand All @@ -23,7 +23,7 @@ public sealed class TextTemplatingFileGeneratorCore : BaseTemplatedCodeGenerator
{
public const string GENERATOR_GUID = "85B769DE-38F5-4CBE-91AE-D0DFA431FE30";
public const string GENERATOR_NAME = nameof(TextTemplatingFileGeneratorCore);
public const string GENERATOR_DESCRIPTION = "Generate files from T4 templates using the .NET 6 runtime.";
public const string GENERATOR_DESCRIPTION = "Generate files from T4 templates using the .NET 8 runtime.";

private const string ERROR_OUTPUT = "ErrorGeneratingOutput";
private const string TEMPLATE_NAMESPACE = "RdJNL.TextTemplatingCore.GeneratedTemplate";
Expand Down
6 changes: 3 additions & 3 deletions TextTemplatingFileGeneratorCore/VSPackage.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//---------------------------------------------//
// Copyright 2022 RdJNL //
// Copyright 2023 RdJNL //
// https://github.com/RdJNL/TextTemplatingCore //
//---------------------------------------------//
using System;
Expand All @@ -18,9 +18,9 @@ namespace RdJNL.TextTemplatingCore.TextTemplatingFileGeneratorCore
public sealed class VSPackage : AsyncPackage
{
public const string PACKAGE_GUID = "68C949A0-7E31-4336-82A1-DBAEFCD2AE62";
public const string PACKAGE_NAME = "Text Templating File Generator .NET 6";
public const string PACKAGE_NAME = "Text Templating File Generator .NET 8";
public const string PACKAGE_DESCRIPTION = TextTemplatingFileGeneratorCore.GENERATOR_DESCRIPTION;
public const string PACKAGE_VERSION = "1.2.0";
public const string PACKAGE_VERSION = "1.3.0";

protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress)
{
Expand Down
6 changes: 3 additions & 3 deletions TextTemplatingFileGeneratorCore/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<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">
<Metadata>
<Identity Id="RdJNL.TextTemplatingCore.Generator.85b769de-38f5-4cbe-91ae-d0dfa431fe30" Version="1.2.0" Language="en-US" Publisher="RdJNL" />
<DisplayName>Text Templating File Generator .NET 6</DisplayName>
<Description xml:space="preserve">Generate files from T4 templates using the .NET 6 runtime.</Description>
<Identity Id="RdJNL.TextTemplatingCore.Generator.85b769de-38f5-4cbe-91ae-d0dfa431fe30" Version="1.3.0" Language="en-US" Publisher="RdJNL" />
<DisplayName>Text Templating File Generator .NET 8</DisplayName>
<Description xml:space="preserve">Generate files from T4 templates using the .NET 8 runtime.</Description>
<License>LICENSE</License>
</Metadata>
<Installation>
Expand Down
2 changes: 1 addition & 1 deletion TextTransformCore/ExtensionException.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//---------------------------------------------//
// Copyright 2022 RdJNL //
// Copyright 2023 RdJNL //
// https://github.com/RdJNL/TextTemplatingCore //
//---------------------------------------------//
using System;
Expand Down
2 changes: 1 addition & 1 deletion TextTransformCore/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2022 RdJNL
Copyright 2023 RdJNL
All rights reserved

More information about this application is available at https://github.com/RdJNL/TextTemplatingCore.
Expand Down
2 changes: 1 addition & 1 deletion TextTransformCore/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//---------------------------------------------//
// Copyright 2022 RdJNL //
// Copyright 2023 RdJNL //
// https://github.com/RdJNL/TextTemplatingCore //
//---------------------------------------------//
using System;
Expand Down
6 changes: 3 additions & 3 deletions TextTransformCore/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("RdJNL")]
[assembly: AssemblyProduct("TextTransformCore")]
[assembly: AssemblyCopyright("Copyright 2022 RdJNL")]
[assembly: AssemblyCopyright("Copyright 2023 RdJNL")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

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

0 comments on commit 0aaf489

Please sign in to comment.