https://kotlinlang.org logo
#dagger
Title
# dagger
c

Colton Idle

05/27/2020, 3:26 AM
Can anyone vouch for speeding up dagger via this snippet in gradle? The snippet seems to: Enable fastInit Disable formatGeneratedSource Enable incremental compilation (I'm using dagger 2.21 so incap isn't enabled automatically) https://github.com/google/dagger/issues/1120#issuecomment-493512366
a

Arun

05/27/2020, 3:31 AM
formatGeneratedSource and incremental compilation are (disabled/enabled) by default in recent Dagger versions. AFAIK fastInit mode only affects runtime performance and not build performance. It can be used to speed up app start up time on large projects.
g

gildor

05/27/2020, 3:39 AM
formatGeneratedSource is disabled by default now, so it’s not required
same as incremental AP, it’s enabled on level of dagger, you just have to enable it for kapt
c

Colton Idle

05/27/2020, 4:00 AM
Thanks @Arun and @gildor Just so that I have this right: 1. fastInit Not needed as it's used to speed up app start time, not build perf. If so, I will leave this off (I'll leave it to whatever the default is) 2. formatGeneratedSource Now disabled by default (this is good, as it should result in faster build time) but I need to investigate how to figure out if this is enabled/disabled on my build/version of dagger 3. incremental compilation I'm using dagger 2.21 (can't upgrade at the moment) and so incremental is disabled by default) need to figure out how to enable, I'm curious about using the snippet in the link. Would that work, or does anyone know how to enable/disable? Can't seem to find in the docs.
g

gildor

05/27/2020, 4:00 AM
but I need to investigate how to figure out if this is enabled/disabled on my build/version of dagger
I think only by debuggin dagger AP code
👍 1
I wouldn’t recommend to enable Incremental AP on older versions of Dagger, there was many fixes for this
c

Colton Idle

05/27/2020, 4:09 AM
Oh yeah? I guess I'll have to look. Maybe I won't focus on enabling incremental kapt on 2.21, but instead focus on upgrading to 2.28
g

gildor

05/27/2020, 4:13 AM
Yeah, I think it’s a better idea
formatGeneratedSource is false by default starting from 2.23 - https://github.com/google/dagger/releases/tag/dagger-2.23
And this option available starting from 2.18 (formatting enabled by default) https://github.com/google/dagger/releases/tag/dagger-2.18
c

Colton Idle

05/27/2020, 4:28 AM
Thank you very much @gildor Appreciate you taking your time to help!
👍 1