I’m working on task configuration avoidance and I’...
# gradle
c
I’m working on task configuration avoidance and I’ve noticed something interesting. Every precomputed script plugin I included into my build increases the “Created during configuration” part of the build scan by 10. Now the docs mention these numbers should be minimized, is it really something negative? For context these plugins I’m including are conventions plugins and if I remove them and apply the config (plugins and all) they contain directly the number of “Created during configuration” stays the same.
v
Can you reproduce that in an MCVE? Yes, that number should optimally be 0
c
I have a small library here which demonstrates this behaviour. If you run a scan on
gradle help
that number will sit at 25, if you simply uncomment the versions convention plugin in the root project it will fall to 15. You can apply the same config and plugin from the convention and it will remain at 15. Which leads me to believe this is somehow related to either pre compiled script plugins or included builds
v
And what do I copy where to, to be able to compare?
c
If you comment out the line
id("versions-conventions")
in the root project. Run
gradle --scan
help you’ll see it drop to 15. Then take the configuration from the convention itself (found in `gradle/plugins/versions-conventions/src/main/kotlin/versions-conventions.gradle.kts`and apply it directly to the root project. Again run a scan on help, the number will remain at 15.
v
Hm, well, good question whether this is expected or not. Could well be you found some bug, or could be that it is expected. You could further investigate by using
<http://systemProp.org|systemProp.org>.gradle.internal.tasks.stats=traces.txt
in your Gradle properties. Then you get a summary of the created tasks and stacktraces where lazy tasks were realized in the given file and can investigate differences or provide the information in some bug report.
c
I posted here, either way it will be interesting to know