How do you generate a build script for all views
Among other things, have a look at the object_definition() function and the sys.objects catalog view. See them in action here. 

But yea... you should probably just use your SQLCompare tool, most RedGate tooling is the gold standard for the functionality if you've got access to it.