Moved build phase scripts to the beginning of the build phase.