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

eclipse annotation processing problems #2987

Open
sb1121 opened this issue Nov 2, 2021 · 2 comments
Open

eclipse annotation processing problems #2987

sb1121 opened this issue Nov 2, 2021 · 2 comments

Comments

@sb1121
Copy link

sb1121 commented Nov 2, 2021

I work on a private project that uses dagger. Occasionally, when fetching code or making edits to dagger related code, eclipse will freak out and projects need to be cleaned. I have attempted to make a simple repro of this problem. The problem that I see normally isn't exactly this, but I hope that solving this will solve my other issues. The usual problems are that certain class files do not exist, or constructors do not exist.

Repro steps:

  1. Checkout https://github.com/sb1121/dagger-test/tree/test-initial
  2. Ensure it compiles in eclipse
  3. Checkout https://github.com/sb1121/dagger-test/tree/test-final (Note that this just adds a single commit)
  4. Refresh the projects in eclipse
  5. Note that there are now build errors. The build errors can be fixed by cleaning the projects.

Example build error: "Could not generate unknown file: Source file already created: /testing-impl/.apt_generated/main/something/MyModule_NameFactory.java."

Desired behavior: no errors when switching between those branches.

@bcorso
Copy link

bcorso commented Nov 10, 2021

Hi @sb1121,

This sounds like an eclipse bug, especially if the build errors are fixed by cleaning the project. I would try filing a bug with the eclipse team first.

@sb1121
Copy link
Author

sb1121 commented Nov 13, 2021

Thanks for the response. I reported it here because I have not seen this behavior in other annotation processors. While searching for more resources, I found this other dagger issue. #442

I am not sure it is related, but I have used the following approach to ensure that annotation processing works when a single file is updated, but an output file takes multiple files as input. https://stackoverflow.com/questions/56133377/how-to-get-all-elements-with-an-annotation-in-an-intellij-incremental-build

I will be adding a comment soon to https://bugs.eclipse.org/bugs/show_bug.cgi?id=542090 which I believe is related to this issue.

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

No branches or pull requests

2 participants