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

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