0
点赞
收藏
分享

微信扫一扫

Post-BUILD Event Command Line


关于 post-build event 的一些例子:(//z 2012-5-18 15:26:21 PM IS2120@

if $(ConfigurationName) == Debug (
  copy "$(TargetDir)myapp.dll" "c:\delivery\bin" /y
  copy "$(TargetDir)myapp.dll.config" "c:\delivery\bin" /y
) ELSE (
  echo "why, Microsoft, why".
)


//z 2012-5-17 12:35:17 PM IS2120@

Pre: 

IF NOT EXIST $(IntDir)..\..\lib mkdir $(IntDir)..\..\lib


Post:


copy $(IntDir)$(ProjectName).lib $(IntDir)..\..\lib 


 //z 2012-5-17 12:47:52 PM IS2120

Add a call statement before all post-build commands that run .bat files. For example,call C:\MyFile.bat orcall C:\MyFile.bat call C:\MyFile2.bat.


Pre-build events do not run if the project is up to date and no build is triggered.




if $(ConfigurationName) == Debug goto :debug

:release
signtool.exe ....
xcopy ...

goto :exit

:debug
' debug items in here

:exit



另外一种,修改csprj


<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
    <PostBuildEvent>start gpedit</PostBuildEvent>
</PropertyGroup>



Pre- and Post-Build Events run as a batch script. You can do a conditional statement on $(ConfigurationName).

For instance

if $(ConfigurationName) == Debug xcopy something somewhere



举报

相关推荐

0 条评论