Creating Visual Studio 2005 Macros
Posted on 2006-10-23
I'd think that this should be simple but I can't seem to find any documentation on how to do this. There are some samples for relatively sophisticated macros. I know that I can record macros as well. However, I need to create some path macros for VS 2005 that I can use in my build process but I don't see how to record just a path this way.
When you look at project properties and edit (for instance) the Command Line in the Post-Build Events you can click on the "Macros>>" button and get a selection of macros that are used in the command line, like $(InputPath). Most of these look like pretty simple replacements for inserting pathnames or module names, etc.
I use this to copy my build files to the actual deployment directory after building, for example:
C:\Program Files\Client\ClientApp\Components (for release builds)
C:\Program Files\Client\Debug\ClientApp\Components (for debug builds)
However, right now I have to hard-code these paths into the command line. I would like to create my own macros, specifically for these deployment directory path names, to use in my post-build command line. I need macros for the something like "DeployDir" or "DebugDeployDir" that could be used instead of the hard-coded paths -- like $(DeployDir). It would be perfect if the macro itself could differentiate between debug and release builds itself and modify the path variable.
And I would need to distribute these macros to all of our developers working on the project. Are these macros (like InputName, InputPath, IntDir, etc.) recorded in a file somewhere that I could look at?
This is pretty urgent, as well.