I have a gradle project and I want to use dagger 2.0 in it. I don\'t know how to configure IntelliJ and gradle to generate files and let IntelliJ find them?
My build
I finished up with the following solution (and it seems to be the simplest one from all the sent answers):
apply plugin: 'java'
apply plugin: 'idea'
def generatedMain = new File(buildDir, "generated/main")
compileJava {
doFirst {
generatedMain.mkdirs()
}
options.compilerArgs += ['-s', generatedMain]
}
idea.module.sourceDirs += generatedMain
dependencies {
compileOnly 'com.google.dagger:dagger-compiler:2.8'
compile 'com.google.dagger:dagger:2.8'
}