CCS6 postbuild 设置

来源:互联网 发布:万能电视遥控器软件 编辑:程序博客网 时间:2024/06/05 14:53

Eclipse project for running a BAT file?



Ask Question
up vote1down votefavorite

Is there some way of creating a project in Eclipse, without any source files, that when built runs a single BAT file (either directly or via a Makefile, either would be all right)?

The goal is to split an existing project with a post-build step (a BAT-file that performs deployment) into two projects, one for building and one for running the deployment BAT-file.

shareimprove this question
 

2 Answers

activeoldestvotes
up vote1down voteaccepted

Take a look at creating an External Tool Launch Configuration via Run->External Tools One type is Program, you can use that to run bat files.

shareimprove this answer
 

up vote-1down vote

I know that this is an old question maybe the answer was irrelevant back then. Currently in Eclipse if you right click to your projects and go to:

Properties->C/C++ Build->Settings

The second tab is Build Steps. You can add both pre and post build steps.

I have found that sometimes the eclipse internal shell is a bit awful. So if you want to run it in Windows shell you can prepend cmd /c and add caret (^) as an escape character e.g. for a_file_with_(escaped)_chars.bat

cmd /c "a_file_with_^(escaped^)_chars.bat"