Replace buld.sh file as the same as in tfs and fix references issue