enable ci build on osx
fix some bugs in build.py
Fix build script: ignore unwanted files
Merge pull request #377 from haiwen/fix_build_script

Fix build script: ignore unwanted files
Merge pull request #373 from haiwen/enable_ci_build

enable ci build on osx
fixed a bug when log file creation failed