Convert to Gradle plugin.