Hello Everyone,
I am currently trying to migrate some of our corporate pipelines using gradle as build tool. What I am experiencing is that the builds are very very slow. One of our services (which I can not share here for compliance reasons) takes about 4 minutes till the start of the first relevant gradle task (here spotlessInternalRegisterDependencies). I have attached a part of the output with the execution times here:
...
19: exec gradle --console=plain --no-daemon test
19: [0.54s]
19: [0.54s] Welcome to Gradle 8.3!
...
19: [0.54s] To honour the JVM settings for this build a single-use Daemon process will be forked. ...
19: [1.24s] Daemon will be stopped at the end of the build
19: [233.1s] > Task :spotlessInternalRegisterDependencies
19: [235.8s] > Task :spotlessKotlin
19: [235.8s] > Task :spotlessKotlinApply
19: [236.0s] > Task :spotlessKotlinGradle
19: [236.0s] > Task :spotlessKotlinGradleApply
19: [236.0s] > Task :spotlessApply
19: [236.0s] > Task :spotlessCheckOrFormat
19: [266.0s] > Task :compileKotlin
19: [325.5s] > Task :processResources
19: [325.5s] > Task :processTestResources NO-SOURCE
19: [332.6s] > Task :compileJava NO-SOURCE
19: [332.6s] > Task :classes
19: [344.9s] > Task :compileTestKotlin
19: [344.9s] > Task :compileTestJava NO-SOURCE
19: [344.9s] > Task :testClasses UP-TO-DATE
19: [356.4s]
19: [356.4s] > Task :test
...
I prepared a much smaller example project here (https://github.com/sbszcz/chuck-norris-international/blob/main/dagger-pipeline/main.go) with almost the same dagger code. The overall execution time is much less but also too much in comparison with a complete local-machine gradle run (without gradle daemon).
Does anyone experience the same behavior and have some best practices with dagger and gradle?
Does it make sense to use the gradle daemon (which I have disabled in the aforementioned pipelines)?
Thanks,
Sebastian