Reputation: 4930
In my build.gradle file I set the following dependency:
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
This will automatically adapt to the latest released version (like it's described here).
How can I check which current release is used in my project?
EDIT 2013-08-08:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
Upvotes: 37
Views: 33295
Reputation: 156
try the following code:
com.android.builder.Version.ANDROID_GRADLE_PLUGIN_VERSION
This is the easiest one I think.
Upvotes: 3
Reputation: 16905
Newer versions of Gradle (3.0+, and possibly earlier) support a built-in buildEnvironment
task that shows the dependency graph for buildscript.
./gradlew buildEnvironment
Upvotes: 24
Reputation: 123890
Showing the resolved dependencies for the build script class path isn't a built-in operation as for other configurations (which can be inspected with gradle dependencies
). However, you can write a task to do so. For example:
task showClasspath {
doLast {
buildscript.configurations.classpath.each { println it.name }
}
}
A variation that just shows the Android plugin version:
task showVersion {
doLast {
println buildscript.configurations.classpath.resolvedConfiguration.firstLevelModuleDependencies.moduleVersion
}
}
Upvotes: 29
Reputation: 3880
To determine what revision of the plugin you are using, check the version declaration in the project-level
build.gradle
file.
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
}
In the above example, the Gradle Android plugin version/revision is 1.3.0
Upvotes: 7