Hi Jos,
So the first place you can put your own template is in your generated code directory alongside all the other tempalte stubs in your own dsl project.
If you then want to share this template with other projects, you can pull most of the code from the template out into a separate .tt file and include that using the same <#@ include ... #> mechanism you'll see that the built-in templates use. The top-level header stub always has to reside in your generated project however.
You should be able to put the file to include alongside the other templates in your dsl tools folder under Tools\DSLTools\TextTemplates\Dsl (or DslPackage) next to the standard ones.
A nicer solution is to keep your own templates separate from the built-in ones by adding your own template directory to the include search path.
You can do this on a per file extension basis by adding a registry key under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\TextTemplating\IncludeFolders\.tt
(or any other file extension you use for your template files instead of .tt)
You then need a string value "Include<N>" where N is a sequential number greater than the last exisiting item there. This value must contain the new include path.
Gareth Jones - Developer - DSL Tools & Software Factories Platform [MSFT] |