When exactly is .gradle folder created in the home directory in Linux? When exactly is .gradle folder created in the home directory in Linux? linux linux

When exactly is .gradle folder created in the home directory in Linux?


Gradle downloads dependencies just-in-time when they are first used. ~/.gradle is used for many purposes, and may be created as soon as Gradle is first started.


When talking about dependencies in gradle, you can categorize them into 2 categories :

  • build script dependencies : the gradle-plugins required by your script (for instance the android-gradle-plugin when you are building an android project). Those dependencies are downloaded at the very first stage of the gradle process.

  • project dependencies : downloaded when they are required. (i.e. if you are building only part of your project: it is possible that some dependencies not required for this part aren't downloaded)

There is a third kind of download : when you use the gradle-wrapper : gradle it-self can be downloaded by the wrapper-script (and of course it is the very first download.)

Regarding the ~/.gradle : it is the GRADLE_USER_HOME (by default USER_HOME/.gradle) : it can be redefined in multiple ways (see here) and it is used as soon as a gradle process is started.


EDIT

A gradle process is started as soon as you run a command starting with gradle <with args> in a directory where a build.gradle exists (note that if you use the wrapper : the command is gradlew <with args>) .

When using an IDE (like Android Studio or IntelliJ) : the IDE can start a gradle process for you. In Android-Studio (or IntelliJ) : there is a view named Gradle Console where you can see logs issued by any gradle process started by the IDE.


when we start the gradle it create the .gradle folder inside your home directory. It consist of native (information about your system) and caches. Caches further consist of plugins and all other jars dependencies.

When we build the project first time at that time it download dependencies and plugins and cheched them here. next time when we need them it, it get from here. even when we need them in eclipse to compile the code (=>gradle eclipse), its dependencies are added from cache