Migrate to Gradle build system