Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support incremental compilation #473

Closed
mannodermaus opened this issue May 15, 2018 · 14 comments · Fixed by #556
Closed

Support incremental compilation #473

mannodermaus opened this issue May 15, 2018 · 14 comments · Fixed by #556
Assignees

Comments

@mannodermaus
Copy link
Contributor

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

@hotchemi
Copy link
Member

Yeeeah!

@meierjan
Copy link

Any updates? :)

@hotchemi
Copy link
Member

hotchemi commented Aug 1, 2018

umm sorry we haven't addressed 🙇

@hotchemi hotchemi added this to the Backlog milestone Sep 26, 2018
@autonomousapps
Copy link

Any update on this?

@hotchemi hotchemi removed this from the Backlog milestone Dec 8, 2018
@hotchemi hotchemi self-assigned this Dec 11, 2018
@hotchemi
Copy link
Member

Dagger's issue: google/dagger#1120
Commit: google/dagger@6baf304

@hotchemi
Copy link
Member

PR: #556
seems this doesn't work well with Kotlin? 🤔

@hotchemi
Copy link
Member

Kotlin issue on Dagger: google/dagger#1283

@autonomousapps
Copy link

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

@tasomaniac
Copy link

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.

@autonomousapps
Copy link

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

@tasomaniac
Copy link

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.

@autonomousapps
Copy link

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!

@hotchemi
Copy link
Member

hotchemi commented Jan 2, 2019

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

@tasomaniac
Copy link

Glad I could help @autonomousapps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants