https://kotlinlang.org logo
#random
Title
a

agrosner

09/16/2018, 10:53 PM
I don't think that is a good idea because it'll catch dependency cycles, missing injections, and other things at compile time that you would uncover at runtime
g

gildor

09/17/2018, 1:30 AM
Not necessary. Toothpick checks dependency cycles and validates graph even with reflections https://github.com/stephanenicolas/toothpick/wiki/Configurations#runtime-checks
p

Paul Woitaschek

09/17/2018, 8:56 AM
I don't really care, I'd be fine finding that on demand and on release builds
I don't need it to be evaluated on each build
a

agrosner

09/17/2018, 10:47 AM
Incremental kapt and multiple modules makes the compile difference negligible. discovering issues at runtime could take longer than compile time
g

gildor

09/17/2018, 1:11 PM
Kapt will never be incremental by default, only Annotation Processor itself, so better to choose AP wisely, but you right now Kapt doesn't support Gradle API for incremental APs
a

agrosner

09/17/2018, 1:26 PM
there is a
Copy code
kapt {
useBuildCache = true
}
which can map input to output and reuse if the input has not changed. That also will allow faster compile with multimodule project. I have a project with 20+ modules that when you make changes that touch a feature module, it only takes about 12-15 seconds to compile.
at that point kapt runs for less than a second or two and most of the time is the recompiling of the feature module
p

Paul Woitaschek

09/17/2018, 1:35 PM
Do you use that in production?
I think I used it before but turned it off due to dagger making mistakes
a

agrosner

09/17/2018, 1:37 PM
yeah but on CI we turn off caching and always do a full recompile
dagger making mistakes , or the kapt cache? I had issues a few versions ago with Kapt, and whenever I ran into an issue it was from moving packages of classes. I would delete the build cache and it would work again. I havent really seen any terrible issues since.
g

gildor

09/17/2018, 2:03 PM
But this is not incremental compilation, if class path of module with KAPT changed (so if any class of module or dependency changed) it will be recompiled even with build cache
5 Views