Setup Dagger with Eclipse
The dependency injection library Dagger by Square setup for using it with Eclipse is a bit different when not using Maven.
At the time of writing, there seem to be no complete explaination on what is needed to setup everything. I got everything working with combined information from the comments in issue 126 by staxgr and arichiardi.
-
Prepare the Eclipse project and create the directories
libsandlibs-compile. -
Download the following libraries:
-
the dagger jars from Maven Central.
-
dagger-x.x.x.jargoes into thelibsdirectorydagger-compiler-x.x.x.jargoes in thelibs-compiledirectory
-
the javawriter jar and put it into
libs-compile -
javax.inject goes into
libs
-
-
Enable Annotation Processing and add all four libraries to the factory path of the annotation processing settings
- Project Properties → Java Compiler → Annotation Processing
- check “Enable project specific settings” and “Enable annotation processing”
- Project Properties → Java Compiler → Annotation Processing → Factory Path
- “Add JARs…” for each downloaded jar
- Project Properties → Java Compiler → Annotation Processing
When starting a build, the generated files should appear in .apt_generated. This directory should be automatically configured as a source folder after annotation processing has Bern enabled.