Dienstag, 27. April 2010

T4 und MSBUILD in VS2010

Oho!

Visual Studio 2010: Code Generation in a Build Process


Incremental Build

By default, the build manager tries to avoid executing a template if its output file is up-to-date. To do this, it monitors the file system to see which files are read by the template code. On subsequent occasions, it compares the modification dates of those files with the date of the output file. It executes the template if any input file has been modified more recently than the output file. The template is also executed if there is no information about previous executions of this template.

The result is that the output file will be regenerated if it is older than any of the following files:

  • The text template file

  • Files that are specified in <#@include#> directives

  • Files that are read by the code in the template

  • Files that are included or read by a directive processor used in the template


Wow! Damit geht nun wesentlich mehr, als bis dato möglich war, mit selbstgestrictker msbuild-Integration, vom simplen Custom-Tool-Aufruf ganz zu schweigen.

1 Kommentar:

  1. Hallo,

    eine sehr gute Beschreibung des Features findet sich hier:

    http://www.olegsych.com/2010/04/understanding-t4-msbuild-integration/

    Viele Grüße

    Tim
    http://t4-editor.tangible-engineering.com

    AntwortenLöschen