Looks like my build src rebuilds on each build (ev...
# gradle
i
Looks like my build src rebuilds on each build (even if i am change nothing inside) and leads whole rebuild of project. Where can i find cause? At the time wrapper is
distributionUrl=https\:<//services.gradle.org/distributions/gradle-7.0.2-bin.zip>
, and AGP version is
7.0.0
t
are you using snapshot/dynamic version dependencies in buildSrc?
i
Some dependencies are really dynamic. Can i somehow cache calculation result?
t
i
Thanks, i’ll check it
n
A build scan will also tell you exactly why tasks are being re-executed.
v
Or also enabling info logging with
-i
if you cannot use build scans. Dynamic versions shouldn't cause a rebuild always afair, just if the resultion result actually changed.
i
I lied a bit. Whole project not rebuilds when source code changed. It only rebuilds if one of build.gradle.kts changed (no matter which)
v
Also shouldn't happen from what you describe, but hard to tell without a build scan and without the build at hand
i
Hmm, i'd decided that dynamic dependencies is dependencies that calculates during build time, but i am wrong, it is dependencies like
dep:1+
. I mean i use dependencies, that calculated during build time. For example version of AGP tried to be fetched from 
local.properties
, but if there isn't it then it fetched from 
gradle.properties
. Add this behavior to override project agp version locally. Can this be reason of rebuilding project? Can i somehow cache calculation results?
v
No, if you run this build 5 times and you always end up with the same calculated version, this is not the reason. What is wrong with looking at a build scan or the info logging? As we said before, it tells you exactly why a task was rerun
i
build —scan somewhy breaks with exception, that starts as described at attached image. I’ll try to find time to dig into and fix it, and then i tell about what i’ll find. Thanks for responses, i’ll come back later ))
n
When you run the build with
--scan
please link the scan here so we can help debug.