3 回答

TA贡献1818条经验 获得超8个赞
将TextTransform.exe添加到 %PATH%
创建了一个名为Transform_all.bat的批处理文件(见下文) 创建预构建事件“ transform_all ..\..
"
变换所有蝙蝠
@echo off SETLOCAL ENABLEDELAYEDEXPANSION :: set the working dir (default to current dir) set wdir=%cd% if not (%1)==() set wdir=%1 :: set the file extension (default to vb) set extension=vb if not (%2)==() set extension=%2 echo executing transform_all from %wdir% :: create a list of all the T4 templates in the working dir dir %wdir%\*.tt /b /s > t4list.txt echo the following T4 templates will be transformed: type t4list.txt :: transform all the templates for /f %%d in (t4list.txt) do ( set file_name=%%d set file_name=!file_name:~0,-3!.%extension% echo: \--^> !file_name! TextTransform.exe -out !file_name! %%d ) echo transformation complete

TA贡献1780条经验 获得超5个赞
安装 安装 在文本编辑器项目文件中打开并添加到文件末尾,但在此之前 </Project>
<!-- This line could already present in file. If it is so just skip it -->
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- process *.tt templates on each build -->
<PropertyGroup>
<TransformOnBuild>true</TransformOnBuild>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\TextTemplating\v10.0\Microsoft.TextTemplating.targets" />

TA贡献1803条经验 获得超6个赞
添加回答
举报