permissions-dispatcher / PermissionsDispatcher

A declarative API to handle Android runtime permissions.
https://github.com/permissions-dispatcher/PermissionsDispatcher
Apache License 2.0
11.22k stars 1.44k forks source link

Add support for gradle incremental annotation processing #556

Closed hotchemi closed 5 years ago

hotchemi commented 5 years ago

Issue

resolves https://github.com/permissions-dispatcher/PermissionsDispatcher/issues/473

Overview

This PR adds incremental compilation support. I suppose right now this feature is only for Java? 🤔

Ref

autonomousapps commented 5 years ago

Kotlin does not have support for incremental annotation processing yet. There's an open issue, can't find the link...

hotchemi commented 5 years ago

@autonomousapps thank you I've just founded on Dagger's repo 🙇 https://github.com/permissions-dispatcher/PermissionsDispatcher/issues/473#issuecomment-446445332

technoir42 commented 5 years ago

@hotchemi for incremental AP to work you also need to provide an originating element for every generated file.

From the Gradle documentation:

They must provide exactly one originating element for each file generated with the Filer API. If zero or many originating elements are provided, Gradle will recompile all source files.

For Java you can use TypeSpec.Builder.addOriginatingElement but I'm not sure what to use for Kotlin. Here is relevant commit from Dagger: https://github.com/google/dagger/commit/baf235794459ea8318b89c9c3eb2f9ef5ede846a

hotchemi commented 5 years ago

@technoir42 ooh thank you let me address!