Search code examples
gradleincremental-build

Gradle incremental on different machines


We have multiple GitLab runners on different machines.

We broke our pipeline in multiple steps that are dependent and I see that gradle doesn't run incrementally.

For example, we have build apk and upload apk to hockeyapp. We always copy apk output from one step to another. However gradle still start building apk from scratch because upload needs it.

  • How can I troubleshoot it?
  • What folders to copy to make sure gradle runs incrementally?

We are on Gradle 4.x (4.1 and moving to 4.2)


Solution

  • I don't think you should do this. You would probably need to copy over the .gradle directory from the root project, but I'm not sure this works too well and as expected. I guess you should instead use the new Build Cache which sounds like being exactly what you need in your situation and is an official feature and does not involve some unsupported copying-around of build metadata.