One of the goals of build automation is to create a robust and reliable process that can be depended upon. To achieve this, our build script needs to be smart, transparent and maintainable.
It’s important to make it easy to understand what our build script has done. A failing build is always a troublesome distraction at an inconvenient time, so we need to make it as easy as possible to identify the problem and move on.
A push button build script that does exactly one thing isn’t that useful - we could achieve as much by building from within Visual Studio itself. The benefits of build automation begin to accrue when we start orchestrating multiple steps. Let’s extend the script to automatically run all our unit tests.
While it’s not strictly required by this project, let’s look at what would be required to set up different build targets for different purposes. Currently our
Compile.Assembly task just compiles whatever defaults are baked into the project. Let’s change that so we can specify whether we want Release or Debug builds.