Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check Gradle version number in build file?

Tags:

java

gradle

Is their some build syntax or something in the Gradle API that I can use to check the Gradle version number?

like image 275
harschware Avatar asked Feb 21 '12 04:02

harschware


People also ask

How do I find my build Gradle version?

In Android Studio, go to File > Project Structure. Then select the "project" tab on the left. Your Gradle version will be displayed here.

How do I mention Gradle version in build Gradle?

You can add the --gradle-version X.Y argument to specify which version of Gradle to use. Now you can run any Gradle task in your project using the gradlew shell script or bat file located in your project's root directory.

Where is Gradle version defined?

You can specify the Gradle version in either the File > Project Structure > Project menu in Android Studio, or update your Gradle version using the command line. The preferred way is to use the Gradle Wrapper command line tool, which updates the gradlew scripts.


1 Answers

gradle.gradleVersion will return the version number, as a String.

like image 58
Peter Niederwieser Avatar answered Sep 21 '22 05:09

Peter Niederwieser