Cache key for Classpath for unit test are differs from the windows and linux environment

Hi All,

I’m still a new to the gradle. Learning new stuffs,so please bare for my ignorance. Unit test which are in the project are not taking the cache from remote location and instead it is executing whenever any dev build the project. So i tried to identify what would be the issue. So i configured the same project both in windows and Linux and I tried to debug with -Dorg.gradle.caching.debug=true i could see the Appending inputFilePropertyHash for ‘classpath’ to build cache key is different for windows and linux. Using gradle version 5.1. Is there any way i can debug what goes in to classpath. What are all the values present in the classpath for the unit tests executed? I dont have a gradle enterprise also to debug further

You probably saw the section on debugging cache misses in the build cache guide. Apart from that, the next step is to look at the elements of the classpath of the task in question by adding some debug logs in the build script. Something like

compileJava.doFirst {
    println classpath.files
}

and then compare the contents of those files for yourself.

Cheers,
Stefan