Refactor build logic.

Change-Id: I6f1b6f60c27dfb2a02070d047c2ce3f7a33cf9f8
27 files changed