I have added four more scripts to the CodePlex project on http://dynamicsaxbuild.codeplex.com/ .
1. CleanAOS.ps1 - this script "cleans" the AOS before a build. Move old layers to the old folder, remove indexes (object, label) etc.
2. ExtractXMLCompileMessages.ps1 - this script extracts specific type of messages from the AX compile log XML and outputs them to the standard output
3. BuildScript.ps1 - this is the main script we use in our TFS build, which uses an AXC file to find all the paths, AOS info etc and runs all the scripts for the build.
I have tried to outline the build flow and some comments per script on the documentation tab on the CodePlex project. Feel free to contact me with questions.
Next problem I will tackle and publish code for is the source control integration problem within AX (one-aos/multi-developer, TFS workspace, etc).