Generate Text from Templates

Generates text from T4 templates into output directory.

Warning

This command will be removed in new versions. It is recommended to use an IDE or open-source alternatives for generating text with T4 templates. See: dotnet-t4

See GENERATE TEMPLATES to get actual T4 templates.

Command

# Windows
Charon.exe GENERATE TEXT --templatePath "c:\my app\template.tt" --namespaces System System.Collection.Generic --outputPath "c:\my app\template.txt"

Parameters

--templatePath

Path to T4 template.

# local file
--templatePath "c:\my app\template.tt"
--outputPath

Specifies the path where the generated text should be written. It can be either an absolute or relative path to a file. The file’s directory must already be present.

# Windows
--outputPath "c:\my app\scripts\text.txt"

# Linux or OSX
--outputPath "~/my app/templates/text.txt"

# Relative path
--outputPath "./my app/templates/text.txt"
--references

List of referenced assemblies used in template. Full path to assemblies should be specified.

# path
--references "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Collections.Concurrent.dll"
--namespaces

List of namespaces used in template.

# list of namespaces
--namespaces System System.Collections System.Collections.Concurrent
--includes

List of other T4 templates to include.

# relative path
--includes "./include.t4"

# Windows
--includes "c:\my app\include.t4"

# Linux or OSX
--includes "~/my app/include.t4" "/var/lib/include.t4"
--referencePaths

List of locations to search for referenced assemblies.

# relative path
--includes "./libs/"

# Windows
--includes "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\"

# Linux or OSX
--includes "/Library/Frameworks/Mono.framework/Commands/bin" "/user/lib/mono"
--createGenerator

Set this flag to get generator’s code instead on generation result.