Permissionsdispatcher: Support incremental compilation

Created on 15 May 2018  ·  14Comments  ·  Source: permissions-dispatcher/PermissionsDispatcher

Gradle 4.7 introduced incremental annotation processing, or InCAP for short. Let's review if our use case can be applied here, so we can speed up project builds using this new incremental mechanism.

More info: https://docs.gradle.org/nightly/userguide/java_plugin.html#sec:incremental_annotation_processing

enhancement

Most helpful comment

Any update on this?

All 14 comments

Yeeeah!

Any updates? :)

umm sorry we haven't addressed 🙇

Any update on this?

PR: https://github.com/permissions-dispatcher/PermissionsDispatcher/pull/556
seems this doesn't work well with Kotlin? 🤔

Kotlin issue on Kotlin issue tracker: https://youtrack.jetbrains.com/issue/KT-23880

One trick is to create a thin Gradle module at top level and keep it kotlin-free. Although that will only contain the top-level DaggerComponent, the generated code in the build is not so small. Keeping it java only at that level with only couple of java files already saves a lot of time.

@tasomaniac can you elaborate on how much time is saved with that approach?

I'm currently experimenting this with 2 projects. They are both small and highly modularized. Incremental build on 1 line change went from 12-15 secs to 7-8 secs. Since numbers are so small, I wouldn't trust.

In our big project, it is not easy to do this since the top module is heavy on Kotlin.

In short, you get rid of 3 tasks: kaptGenerateStubs, kapt, kotlinCompile and javac becomes incremental.

Theoretically, this makes a lot of sense to me. I just want some good metrics. Might be a useful suggestion I can give people when they ask about improving Android build times. (I work for Gradle and one of my primary missions is helping Android teams improve build perf.) Thanks for the idea!

Thank you folks, let us know if there's something that is applicable to PermissionsDispatcher!

Glad I could help @autonomousapps

Was this page helpful?
0 / 5 - 0 ratings