Where/how does gradle store up-to-date checks

So my company just recently switched to gradle and we’re having an interesting situation. The way our deploy process works is that we:

  1. build on a master machine
  2. rsync the build directory to slave machines, which actually run the code

This has been working fine and all but we ran into a bug (on our side) which makes me very curious about how gradle stores that a file is up to date. The bug we ran into was:

  • We we’re excluding the output of a task A from being rsync’d
  • Our old build system did generate the file so an old copy did exist on the slave
  • On the slave machine, rerunning task A did not attempt to regenerate the file (hypothetically it should have since the input file is newer than the output file)

So what I think is happening is that gradle stashes hashes of the input files and output filenames. Because the input hash matched the file that was sync’d, and the output file existed (from the old build sytem), gradle thought the task was up to date… Does that sound right?

Gradle hashes file content for both inputs and outputs. This means that a change to the output (or in this case a stale out put) should cause the task to be out of date. That said, the incremental task information is stored in the .gradle folder in the root project directory. You may want to ensure that this directory is being included when performing the rsync.