Most (all?) T4 templates transform some input other than the template itself, and the output they generate is dictated by the extension in the output directive. So the input/output check can only be done in an automatic fashion if you parse the T4 for the output directive AND somehow figure out what the template is reading to perform the transformation.
One way of solving both would be by adding item metadata specifying that, which would be fairly straightforward but require manual changes to the project files.
I have just a few text transforms in a project file that over 100 other projects depend on. Because the transformation happens every time, every build causes a rebuild of everything. I would like to manually edit the project file to specify the input files and the output file and if any input is newer than the output file to run the transform. Is this purely a function of the project file or would this require changes to TransformOnBuild as well?
On Daniel's blog [1] it says this:
I have just a few text transforms in a project file that over 100 other projects depend on. Because the transformation happens every time, every build causes a rebuild of everything. I would like to manually edit the project file to specify the input files and the output file and if any input is newer than the output file to run the transform. Is this purely a function of the project file or would this require changes to TransformOnBuild as well?
[1] http://blogs.clariusconsulting.net/kzu/how-to-transform-t4-templates-on-build-without-installing-a-visual-studio-sdk/