fix(build): use the same app object throughout the build process

apps.get seems to always return a new object now, so use the same app
object rather than getting a new one.

TODO: should we restore the original behavior of apps.get?