ligershark / template-builder

This project will output a NuGet package which can be used to help create Visual Studio Item Templates and Project templates
Other
42 stars 28 forks source link

Update to preprocess templates #8

Closed sayedihashimi closed 11 years ago

sayedihashimi commented 11 years ago

There should be a way to pre-process templates (especially project templates) to replace text file contents.

sayedihashimi commented 11 years ago

Resolved with commit 45de0c8af56fb55e094fce202a0230e2b123b677.

To use this feature you have to create a templateinfo.xml file in the Definitions folder. This is a simple xml file. Currently it just contains replacement info. Below is a sample of this file.

<?xml version="1.0" encoding="utf-8" ?>
<TemplateInfo>
  <Replacements Include="**\*" Exclude="**\*.png;**\*.jpg;">
    <add key="SideWaffleProjectName" value="$safeprojectname$"/>
  </Replacements>
</TemplateInfo>

Note: Include and Exclude are not actually implemented yet. I expect them to just be MSBuild Include/Exclude expressions.

Take a look at SampleWeb in under ProjectTemplates\Web\SampleWeb