Context
I have started a personal project in java with Gradle
as the build system and I want to use Dagger 2 as a DI. The main reason o
I'm using version 2017.3.3
of IntelliJ IDEA, version 0.14
of the net.ltgt.apt
plugin and version 2.14.1
of Dagger and as well as applying the idea
plugin in the build.gradle
file (as in Pelocho's answer) I found I also had to tell IntelliJ where it can find the sources generated by Dagger, as follows:
apply plugin: 'idea'
idea {
module {
sourceDirs += file("$buildDir/generated/source/apt/main")
testSourceDirs += file("$buildDir/generated/source/apt/test")
}
}