Gradle uses two main feature to reduce build time, incremental builds and task output caching.
Incremental builds is used when your run a task that hasn't changes sinces the last time you have run it, for this to work gradle stores finger prints and stuff in a local directory name .gradle. When you run a task that has been already executed and hasn't changed then UP-TO-DATE
is printed next to the task.
Task output caching is mostly used for CI environements when the local repository is removed and checked out in each stage of the CI job, which mean that the local directory .gradle that holds tasks finger prints etc.. will disapear after each stage, therefor tasks will be rebuilt each time and Incremental build won't work. Here comes the role of tasks output caching, when used gradle will generate a cache that can be applied to repopulate the local .gradle directory, when the build cache has been used to repopulate the local directory the tasks are marked as FROM-CACHE
, once the local direcotry has been repopulated the next execution will mark tasks as UP-TO-DATE
and not FROM-CACHE
.
I hope this helps understand the difference between UP-TO-DATE
and FROM-CACHE