VS2008高级用法--编译事件
2011-04-20 22:28
447 查看
在vs2003 和2005中都支持了Build Events, 但是2003只支持单行的命令,而2005可以支持多行命令.
要想在2003中执行多行命令,只能把命令写在一个批处理文件中,然后通过调用批处理来执行.
1.在Solution explorer中用context meun查看project的property.
2.选择Build Events,可以看到Pre-build 和Post-build event command line,以及运行Post-build event 的条件
//——————————————————
用法收集
1.build完后修改build产物的名字(后缀),并覆盖已有的同名文件.
copy $(TargetFileName) $(TargetName).XXX y
2. 调用外部命令或批处理:
call "C:/Program Files/XXX.exe"
3. 条件判断:
IF NOT $(ConfigurationName) == Release GOTO end
call "C:/Program Files/XXX.exe" $(ProjectDir)$(TargetName).cvp
:end
4.web project 自动部署
copy $(TargetDir)*.* //MyServer/MyService/bin
copy $(ProjectDir)*.ascx //MyServer/MyService
5. copy from one path to the other path
Copy "$(ProjectDir)pri.bin" "$(SolutionDir)$(SolutionName)/$(OutDir)"
copy pri.bin(file name) from $(ProjectDir) to $(SolutionDir)$(SolutionName)/$(OutDir)
//——————————————————
Macro收集
$(DevEnvDir)
$(ProjectDir)
$(BuiltOuputPath)
$(ConfigurationName)
$(TargetName) 不含扩展名
$(TargetFileName) 包含扩展名
要想在2003中执行多行命令,只能把命令写在一个批处理文件中,然后通过调用批处理来执行.
1.在Solution explorer中用context meun查看project的property.
2.选择Build Events,可以看到Pre-build 和Post-build event command line,以及运行Post-build event 的条件
//——————————————————
用法收集
1.build完后修改build产物的名字(后缀),并覆盖已有的同名文件.
copy $(TargetFileName) $(TargetName).XXX y
2. 调用外部命令或批处理:
call "C:/Program Files/XXX.exe"
3. 条件判断:
IF NOT $(ConfigurationName) == Release GOTO end
call "C:/Program Files/XXX.exe" $(ProjectDir)$(TargetName).cvp
:end
4.web project 自动部署
copy $(TargetDir)*.* //MyServer/MyService/bin
copy $(ProjectDir)*.ascx //MyServer/MyService
5. copy from one path to the other path
Copy "$(ProjectDir)pri.bin" "$(SolutionDir)$(SolutionName)/$(OutDir)"
copy pri.bin(file name) from $(ProjectDir) to $(SolutionDir)$(SolutionName)/$(OutDir)
//——————————————————
Macro收集
$(DevEnvDir)
$(ProjectDir)
$(BuiltOuputPath)
$(ConfigurationName)
$(TargetName) 不含扩展名
$(TargetFileName) 包含扩展名
相关文章推荐
- Net中事件的高级用法之三
- JAVA高级:反编译工具jad的简单用法
- C# 高级知识 事件的标准用法
- Android Gradle高级用法,动态编译技术:Plugin Transform Javassist操作Class文件
- Python tkinter事件高级用法实例
- tkinter事件高级用法实例
- JavaScript高级用法一之事件响应与网页交互
- 条件编译命令 `ifdef、`else、`endif 的用法
- 百度和谷歌最全的搜索引擎高级语法收集及其用法
- UIALertView的基本用法与UIAlertViewDelegate对对话框的事件处理方法
- Newtonsoft.Json高级用法 - 转
- 一些Select检索高级用法
- JQuery中DOM事件合成用法实例分析
- makefile高级用法--隐含规则
- 如何使用 VS2008 编译驱动程序
- 在VS2008环境编译C程序
- web前端之JavaScript高级程序设计六:事件
- React Native ref高级用法&&setNativeProps使用
- form表单中input标签的11个高级用法
- C++事件处理中__event与__raise关键字的用法讲解