Migrate build to Gradle