Rewritten build.dart to make sure that tools can run.