Due to the fact that a file was used as task input, it was placed in the configuration cache as entry, and changing this file causes the cache invalidation.
Problem in line localArtifact.set(variant.artifactGenTask.flatMap { task -> task.artifactFile }). flatMap function behaves strangely enough with the configuration cache, see also https://github.com/gradle/gradle/issues/25645
Due to the fact that a file was used as task input, it was placed in the configuration cache as entry, and changing this file causes the cache invalidation.
Problem in line
localArtifact.set(variant.artifactGenTask.flatMap { task -> task.artifactFile })
. flatMap function behaves strangely enough with the configuration cache, see also https://github.com/gradle/gradle/issues/25645Fixes #646