Tuesday, 10 September 2013

Reading MSBuild arguments from build pre / post events

Reading MSBuild arguments from build pre / post events

I have a post build event that I need to behave differently based on which
build definition it is built from. For example:
Build Def 1: Copy output files & call external script
Build Def 2: Just copy files
I need them both to build under the same configuration, so I thought it
should be possible to pass through a custom property, like this:
/p:myproperty=build1
And then read it. But I can't seem to find any way to do that. The other
option would be to obtain the name of the build itself from within the
build event; although again, I can't see any way to get this.
Can anyone tell me a way to do either of these things or, if not, an
alternative to achieve what I'm trying to?

No comments:

Post a Comment