Try this little toy to help with colouring / syntax. Haven't got the exact
link
 
Tangible Modelling Tools with T4 editor or something similar...
 
Rob

  _____  

From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com]
On Behalf Of Greg Keogh
Sent: Saturday, 19 June 2010 3:57 PM
To: 'ozDotNet'
Subject: T4 templates



Folks, I've been experimenting with T4
<http://www.olegsych.com/2007/12/text-template-transformation-toolkit/>
templates and the T4 Toolkit and I'm reasonably impressed. I never knew this
tool existed until David K mentioned it a few months ago. If anyone else in
here needs basic file generation from templates then T4 is great. It's
nicely lightweight and easy to learn compared to the huge expensive bloat of
something like CodeSmith. Some comments:

 

Without a colour coding IDE it's a dreadful eye and brain strain to write
the templates, as all the source and template mingled with <#+ and #>
delimiters looks like spaghetti. I've seen ads for some non-free products
for T4 editing, but I personally don't need them. My largest template (my
first) is about 300 lines long and it took hours to write by hand in a plain
text editor. 

 

One tiny mistake and you're stuffed with cryptic errors and you have to
carefully inspect what you've done to find the cause. I tried to following
Oleg's debugging instructions once, but it stalled VS2008 and I had to kill
the task.

 

T4 #@ import directives have poor support for relative paths to templates,
so it's hard to put your tt files in a shared location. Oleg's article uses
a registry edit to set a default search path. This is rather irritating.

 

When you use a "generator" to punch out multiple files, you always get one
spurious extra empty file that is the same name as the template. This is a
minor irritation that I can't find a way of avoiding.

 

Overall through, it's a great free tool.

 

Greg

Reply via email to