When I start working on a new project, I usually just start in Visual Studio. But before too long, I add a “build script” that:
- Makes it easier to do the boring and repetitive stuff. Building everything, testing everything, etc.
- Helps me avoid random issues: forgetting to add something to source control, incremental build issues, etc.
- Clean: Delete all generated/built files. Throw an error if there’s a file that didn’t make it into source control.
- Full: Do “Clean”. Then build all the code and run all the tests.
- Official: Do “Build”. Then copy the generated files to a “drop” directory. Then increment version number and save it in source control.
Once I have a script like that, here’s how I develop:
- Make additions/edits in Visual Studio. Run tests in Visual Studio.
- Run “Full” using the script to make sure everything builds and works successfully. If not, go back to #1.
- Add changes to source control. If I want to add more to this version, I go back to #1.
- Run “Official” using the script to make an official build. Publish new files to NuGet, etc.
- Go back to #1 to start working on code for the next version.