Usando Text Templates desde la linea de comandos
Es posible usar las plantillas de texto de visual studio (t4) directamente desde la línea de comandos.
Para ello, hay que ejecutar el programa TextTransform.exe que encontraremos en la carpeta
%Program Files%\Common Files\Microsoft Shared\TextTemplating\1.1
[sustituir %Program Files% por la ruta de la carpeta Archivos de Programa]
Hay que pasar como parámetro el archivo de .tt que queremos transformar.
Si lo ejecutamos sin parámetros tenemos la definición de los parámetros que acepta el programa
C:\Program Files\Common Files\Microsoft Shared\TextTemplating\1.1\TextTransform.exe
TextTransform - Transforms the given text template.
This command runs a transform using a text template.
Usage: TextTransform [<options>] <templateName>
Options:
-out <filename>: The file to write the output of the transform to.
-r <assembly>: Reference an assembly for compiling and running the text
template
-u <namespace>: Import a namespace for use within the text template
-I <includedirectory>: Provide a directory containing text templates included
from within the given text template
-P <referencepath>: Provide a directory to search for referenced assemblies
specified within the text template or using the -r option
-dp <directiveprocessorname!directiveprocessortype![assembly|codebase]>:
Specify the name, full type name, and assembly of a directive processor
that can be used to process custom directives within the text template
-a <[directiveprocessor]![directiveid]!parametername!parametervalue>: Specify
a parameter that a directive processor can query for as a name/value pair.
The directive processor and identifier are optional allowing parameters to
be specified for any directive processor or any instance of a particular
directive processor.
|
Fuente:
http://blogs.msdn.com/garethj/archive/2007/08/14/transforming-dsl-setup-t4-templates-from-the-command-line.aspx
http://msdn.microsoft.com/en-us/library/bb126245.aspx