add gradle script and make it pass on mac