Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle basedir property

Tags:

Is there an ANT equivalent basedir property in gradle?

${basedir} 

I am trying to get the name of the directory where the build script is located.

Thank you in advance!

like image 572
Maxim Neaga Avatar asked Apr 19 '13 18:04

Maxim Neaga


People also ask

What is rootDir in Gradle?

rootDir. The root directory of this project. The root directory is the project directory of the root project. rootProject. The root project for the hierarchy that this project belongs to.

What is Ext block in Gradle?

All enhanced objects in Gradle's domain model can hold extra user-defined properties. This includes, but is not limited to, projects, tasks, and source sets. Extra properties can be added, read and set via the owning object's ext property. Alternatively, an ext block can be used to add multiple properties at once.


Video Answer


1 Answers

Depending on your exact needs, you could use buildFile.parent or projectDir. (The build file path defaults to "$projectDir/build.gradle" and can be reconfigured in settings.gradle.) See the Gradle Build Language Reference for which properties and methods are available on Project and other classes.

like image 189
Peter Niederwieser Avatar answered Sep 30 '22 17:09

Peter Niederwieser