Expert .NET Delivery Using NAnt and CruiseControl.NET
I haven’t had a chance to read this book yet, but it looks like it will be full of great information. Chapter 9 talks about using code generation techniques (CodeSmith in particular) to aid in the delivery process.
http://www.amazon.com/exec/obidos/tg/detail/-/1590594851/ref%3Dase%5Ftestdrivendev-20/103-8305158-7865422