modified .gitignore and add buildDir
add writeToFile()