locked
Output Path Directive Processor RRS feed

  • Question

  • Hi,

    I don't know if it is by design, or that I am using DSL's in a wrong mindset, but I don't like where the output of the text templates are placed: nested in their text template!
    I would like to place all output in a "generated" directory. I've looked but didn't find any solution to do this inside VS. I though the logical place to find this is in the output directive, but it isn't there!
    So, my question is: can I alter/remake the output directive to include a "path" property? I've seen that you can build custom directive processors, but I've yet to come across an example where I can alter the path (I bet there is some kind of OutputGenerator where I can set properties?). Is there an example like this? Or, perhaps you could point me to the assembly containing the default directive processors, so I can take a look at them myself (using reflector, or so).

    Thanks,

    Michel van den Berg - Microsoft Student Partner
    Sunday, June 29, 2008 1:09 PM

Answers

  • Michel,

    This is a limitation of T4 host design which runs as IVsSingleFileGenerator custom tool in Visual Studio. If you want to save output file to a special folder, you will need to code it manually in your template, using Visual Studio extensibility APIs. Perhaps this article will give you some information to get started. I don't think this can be accomplished in a custom directive processor.
    Oleg
    • Marked as answer by Feng Chen Monday, June 30, 2008 3:15 AM
    Monday, June 30, 2008 1:34 AM

All replies

  • Michel,

    This is a limitation of T4 host design which runs as IVsSingleFileGenerator custom tool in Visual Studio. If you want to save output file to a special folder, you will need to code it manually in your template, using Visual Studio extensibility APIs. Perhaps this article will give you some information to get started. I don't think this can be accomplished in a custom directive processor.
    Oleg
    • Marked as answer by Feng Chen Monday, June 30, 2008 3:15 AM
    Monday, June 30, 2008 1:34 AM
  • For those that seek the same functionality as described above, I've implemented a macro for it, which can be set as a toolbar button.
    See it here: http://www.promontis.nl/News/08-07-04/DSL_Tools_Transform_All_Templates_And_Export_To_Directory.aspx
    Saturday, July 5, 2008 4:35 PM