Revert "Don't delete build directory in build tasks."

This reverts commit 3d0acb4e7e3f337a560daf9a5d49a22c85c35258.

(cherry picked from commit 2c0e777f472b267a0aea81338fe60cd4c448ed63)