Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom Build Step problem

Status
Not open for further replies.

Malachi

Programmer
Aug 13, 2001
38
0
0
US
I have a custom build step in which the Commands are:
Code:
mkdir ..\MYPROGRAM\HELP
mkdir ..\MYPROGRAM\DATA
mkdir ..\MYPROGRAM\LOGS
mkdir ..\MYPROGRAM\DEMO

and the Outputs are
Code:
..\MYPROGRAM\DEMO
..\MYPROGRAM\DATA
..\MYPROGRAM\HELP
..\MYPROGRAM\LOGS

I assigned this custom build step to 10 of my projects. When I compile these projects in a batch, the custom build step is invoked before the first project output file is produced. Subsequent project compilations invoke the same custome build step and produce the error:
Code:
Performing Custom Build Step on \MYPROGRAM\IEXCLDEF.exe
A subdirectory or file ..\MYPROGRAM\DEMO already exists.
A subdirectory or file ..\MYPROGRAM\DATA already exists.
A subdirectory or file ..\MYPROGRAM\HELP already exists.
A subdirectory or file ..\MYPROGRAM\LOGS already exists.

I thought that, by adding the entries in the Output section of the Custom Build tab, the timestamps would be compared and the actions would be conditionally performed. I guess this was wrong. How can I conditionally perform the Custom Build steps I need and avoid this error?
 
I found this annotation from josh's Weblog

a key to effective use of custom build steps and build events is to use macros wherever possible. rather than hard-coding paths, use macros that point to the appropriate locations. this not only makes it easier to share projects among a team, but helps make the projects more maintainable. also remember that the command lines for these tools is executed as a batch file. anything you can do in a batch file or cmd script you can do in a custom build step or build event, and this gives you quite a bit of power.

I will pursue using a macro. If anyone has a better suggestion it would be appreciated.

Thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top