Skip to content

DDJarod/Dagger_2_Component_Problem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dagger_2_Component_Problem

This is a poorly created two project repository to show a problem I have with googles dagger 2.

How to run

I use gradle 2.3.10 and java 8 in cygwin under windows 8.

Clone this repository and execute a 'gradle clean compileJava' inside the 'DaggerUsingProject'. Afterwards check 'build/generated/source/apt/main/di' for a generate Dagger component

Where is the problem?

When a second AnnotationProcessor builds sources, those are not completely detected/processed by dagger. Dagger will create some files for them, but not all.

In the state the project is checked in, after compile there is no Dagger component generated from 'di.ProjectComponent'. But there was no error during compilation although dagger picked up the file generated by the custom AnnotationProcessor, because there are MembersInjector and Factory classes generated for it.

When the 'di.RandomInterfaceModule' method 'RandomInterface provideRandomInterface' uses 'CopiedFromOtherProcessor' instead of 'GeneratedByOtherProcessor' as argument (which is a copy from the generated file, except the classname) then the project still compiles without error AND it will generate the Dagger component file correctly.

Dagger 2 issue created about this: google/dagger#269

About

repository contains two projects to show a problem with google dagger 2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages