Dagger 1.2.2, Gradle 2.4, Eclipse 4.5.0 Mars on OSX 10.9.5.
Attempting to run a JUnit test fails within Eclipse: "Please ensure that code generation was run for this module."
This is a Gradle project in Eclipse with the versions shown above.
JUnit tests run successfully from the command line ("./gradlew clean test").
Project Properties:Java Compiler:Annotation Processing shows: all check boxes checked. Generated code goes to .apt_generated. No Processor Options are specified.
Project Properties:Java Compiler:Annotation Processing:Factory Path shows: dagger-compiler-1.2.2.jar is present and checked, javawriter-2.5.0 is present and checked, dagger-1.2.2.jar is present and checked.
org.eclipse.jst.ws.annotations.core is present but not checked (checking it and rebuilding doesn't seem to make any difference).
The "checked" jars are all being taken from my ~/.gradle/caches directory.
Nothing appears in the .apt_generated directory (I gather that generated class files are supposed to appear there; I've never seen any.)
Thoughts? [Edit: added missing word "line"]
Another developer here knew the answer to this question:
Open the Properties of the project that uses Dagger (use the project context menu, not the main menu).
Go to Java Compiler: Annotation Processing.
Deselect the Enable Annotation Processing checkbox.
Click Apply. You should be prompted to rebuild the entire project; yes.
Reselect the Enable Annotation Processing checkbox. Apply. Rebuild the project.
The generated classes should now appear in .apt_generated.
I don't know exactly how this might interact with the Build Automatically setting on the project, but I think it's safe to call this a bug in Eclipse. I will see about filing a bug against Eclipse.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With