Context
I am writing a Gradle plugin for Android projects. My plugin relies on some methods from the Android Gradle plugin, but the exact calls I need to use have changed as the Android Gradle plugin develops (for example, the methods I need are different from v2.1.2 vs v.2.2.2 the Android Gradle plugin ) I want to get the version of the Android Gradle plugin programmatically from my own plugin, and then call the appropriate methods for this version.
Question
How can I access the version of the Android Gradle plugin programmatically from my own Gradle plugin? Invokes
project.rootProject.buildscript.getDependencies()
right starting point?