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

Add support for incremental annotation processing with Gradle 4.7+ #620

Open
lucamtudor opened this issue Dec 4, 2018 · 9 comments
Open

Add support for incremental annotation processing with Gradle 4.7+ #620

lucamtudor opened this issue Dec 4, 2018 · 9 comments
Assignees
Labels
Milestone

Comments

@lucamtudor
Copy link

@lucamtudor lucamtudor commented Dec 4, 2018

Gradle 4.7 added support for incremental annotation processing, docs here.

For additional help, follow up with the gradle dedicated issue.

@greenrobot-team

This comment has been minimized.

Copy link
Collaborator

@greenrobot-team greenrobot-team commented Dec 4, 2018

Thanks. Already looked into this a while ago and the issue is that our processor does not really fit either mode. @Entity classes cause generation of multiple files (Entity Info, Cursors), but all entity classes are also aggregated in a single class (MyObjectBox).

In addition, for relations multiple @Entity classes may influence the contents of a generated class. This does not seem to fit "isolating" mode.

The ObjectBox processor also can't use "aggregating" mode because it needs access to parameter names (would require a compiler flag with that mode).

Side note: when using the Android Plugin it is still unclear (last time I checked) how to do incremental annotation processing anyhow.
-ut

@lucamtudor

This comment has been minimized.

Copy link
Author

@lucamtudor lucamtudor commented Dec 7, 2018

I'm afraid I can't help, I'm no gradle wizard.

@greenrobot greenrobot added the feature label Dec 30, 2018
@greenrobot-team

This comment has been minimized.

Copy link
Collaborator

@greenrobot-team greenrobot-team commented Jan 15, 2019

News: with Android Gradle Plugin 3.3.0 incremental annotation processor support is available for Java-only projects. But not for Kotlin or mixed Kotlin+Java projects.

Also, there is a note that it does not work with Gradle 5.1 and higher.
https://developer.android.com/studio/releases/gradle-plugin

So: nothing to do here for now.
-ut

@dbriggsDFleet

This comment has been minimized.

Copy link

@dbriggsDFleet dbriggsDFleet commented Sep 3, 2019

Can this be unblocked with the release of Android Gradle Plugin 3.5.0? "Additionally, KAPT 1.3.30 and higher also support incremental annotation processors, which you can enable by including kapt.incremental.apt=true in your gradle.properties file."
https://developer.android.com/studio/releases/gradle-plugin#3-5-0

@greenrobot-team

This comment has been minimized.

Copy link
Collaborator

@greenrobot-team greenrobot-team commented Sep 9, 2019

@dbriggsDFleet Sure, but the biggest, unresolved issues are still those described in #620 (comment).

@jrcacd

This comment has been minimized.

Copy link

@jrcacd jrcacd commented Oct 8, 2019

This is a must.
With incremental annotation processing we could do really fast unit testing with objectBox, as we would have to wait a lot less for the project to compile

@greenrobot-team greenrobot-team self-assigned this Nov 19, 2019
@greenrobot-team greenrobot-team modified the milestone: 2.5.1 Jan 28, 2020
@greenrobot-team greenrobot-team added this to the 2.5.1 milestone Feb 11, 2020
@greenrobot-team

This comment has been minimized.

Copy link
Collaborator

@greenrobot-team greenrobot-team commented Feb 11, 2020

We just released 2.5.1 which supports incremental annotation processing. It is turned off by default.

To turn it on set objectbox.incremental to true in build.gradle:

android {
    defaultConfig {
        javaCompileOptions {
            annotationProcessorOptions {
                arguments = [ "objectbox.incremental" : "true" ]
            }
        }
    }
}

This configuration works for both Android Java and Android Kotlin projects.

We appreciate your feedback on this feature.

If all goes well, incremental annotation processing will be on by default in a future release.

@sebhard

This comment has been minimized.

Copy link

@sebhard sebhard commented Feb 11, 2020

Great, will try it out asap!

@greenrobot

This comment has been minimized.

Copy link
Member

@greenrobot greenrobot commented Feb 11, 2020

If you see improved build times, we'd be very happy if you could share some numbers from your project (e.g. build times before and after).

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

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.