Refactor and set scripts/build.xml to auto run.