refactor Gradle plugin to use common plugin runtime