I am splitting T4 code in separate files for modularity and reuse but I am finding out that each file costs me an empty line in output. For example:
<#@ template debug="false" hostspecific="false" language="C#" #>
<#@ output extension=".ttinclude" #>
<#@ Import Namespace="System.Collections.Generic" #>
<#@ Include file="Includes.tt" #>
namespace <#= NameSpace #>
{
If Includes.tt lists 3 other *.tt files, I get 3 blank lines before the namespace. As I am adding code and splitting it in separate *.tt files, this empty space keeps growing. In fact, I packed all the include files into a single Includes.tt, hoping that this will cost me just one empty line. It didn't. I still get one empty line per each file listed in Includes.tt. Is there a way of avoiding this?
Edit: assuming that I am not making just a dumb mistake (and I sincerely hope that I am), the problem is not as trivial as it may appear on the first sight:
a) Reuse and modularity via included T4 files is as old as T4 itself and was mentioned in latest MSDN Magazine article: "Managing Complexity in T4 Code-Generation Solutions".
b) If code is auto-generated, it doesn't mean that it is Ok for it to be badly formatted or poorly legible.
c) With the current solution, in my case, for each and every generated .cs file the reader would have to scroll for one empty page until she starts seeing some generated text. All because I have split my code generation between multiple included .tt files. That just doesn't seem right.