开发者

How to run an ant script from VC++

Assume a Visual C++ solution that outputs several executables. These executables are meant to be run in a certain order and with certain 开发者_如何学JAVAparameters -- and for this purpose there already is an ant build.xml script.

What would be a decent approach to integrating this ant script with VC++, such that the ant script will point against the recently output executables (.\Debug and .\Release folders) and ideally could be run directly from VC++, and dare I say with remote debugging.

I was thinking of using build post-events that populate a build.properties file with the output location of each executable, and let the ant script use this .properties file.

Any help on the matter would be great.


I'm not sure if there is a good answer for this. Perhaps you are not asking the right questions. From C++ you can launch anything, including scripts. I'm not sure what you mean by VC++ integration.

The generic answer would be:

  • save the output locations somewhere, doesn't matter where (file, registry, environment variables etc.)
  • retrieve them in the script before use

But depending on what you need, you could also try:

  1. Output the same executables in the same folder structure. This way you can use relative paths.
  2. Use a post-build event which copies the script in the output folder and make it use the relative path.
  3. Instead of a script you can also try handling everything from the first EXE. Instead of an ANT script it could use a configuration file which specifies execution order and parameters.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜