Set build before splitting shards

Adds also a test for splitting.

Change-Id: I4e4112538e9af8642af0bb5f0044e1005ea9048d
5 files changed