MSBuild is now the build engine for all supported languages in Visual Studio. I’d like to start taking advantage of that system in order to simplify a ton of logic I have crammed into pre- and post- build scripts.
To that end, I’d have to write the MSBuild script manually, because I’d like to have more than one target in a single file. I.e. I’d like to be able to just type “msbuild myproject.msbuild”, and have the whole works build itself from scratch, like I can with, say, make.
But, I’d rather avoid having to maintain completely separate “project” files for Visual Studio given that it’s all built on top of MSBuild now anyway.
Is there a way for me to do this?
My advice would be to just consolidate any targets into a common area that can be shared by all your projects, and call those targets from your standard projects.
That should also work for custom tasks that you may want to add, although we ended up using a similar approach to the way the MSBuild Community Tasks integrated themselves into MSBuild, it’s open source so you can see how they did it, although this may be overkill for your requirements, and I probably wouldn’t go this far again unless absolutely necessary.