Okay so when exactly does gradle begin downloading dependencies? And when exactly is .gradle folder created in the home directory.
A . gradle folder is always created when running gradle in a directory, unless there is a settings.
The top-level build file The top-level build.gradle file, located in the root project directory, defines dependencies that apply to all modules in your project. By default, the top-level build file uses the plugins block to define the Gradle dependencies that are common to all modules in the project.
The Gradle user home directory ( $USER_HOME/.gradle by default) is used to store global configuration properties and initialization scripts as well as caches and log files.
gradle directory is to try and keep the build process all contained in one location (e.g. if the app project files are on another drive). On some Windows computers the C: drive may be low on space. This means programs and files may need to be installed and run from another drive.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With