Migrate build to gradle