I'm trying to use such simple scheme in my project:
Item.cs -> this contains c# partial class with simple entity properties. It has set also property "Custom Tool: T4ScriptFileGenerator" so it attaches "grouped" file Item.tt to it. Wich on its way generates Item.generated.cs, grouped to Item.tt. So it results in a grouped tree in solution explorer:
Item.cs
˪Item.tt
˪Item.generated.cs
You can see below how it looks in .csproj file.
Whole project is connected to TFS 2010 workspace.
The problem is:
When I edit Item.cs, t4 engine recreates Item.generated.cs file, but does not check out it from tfs. It automatically checks out only first two levels of "grouped" files - Item.cs and its dependant Item.tt. The Item.generated.cs is updated, but simple overwriten, without checkout.
If I edit Item.tt file or just press "Run custom tool" on it - again two files are checked out: Item.tt and its dependant Item.generated.cs This is weird because forces us to manually "run custom tool" on every *.tt file after editing entity class files to ensure nothing is missing from TFS.
Q: Is there any way to force it to check out whole tree of DependentUpon files when main Item.cs is edited?
Here is how it looks in .csproj file source:
<Compile Include="Entities\Item.cs">
<Generator>T4ScriptFileGenerator</Generator>
<LastGenOutput>Item.tt</LastGenOutput>
</Compile>
<None Include="Entities\Item.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Item.cs</DependentUpon>
<LastGenOutput>Item.codegen.cs</LastGenOutput>
</None>
<Compile Include="Entities\Item.codegen.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Item.tt</DependentUpon>
</Compile>