Migrate building to Gradle