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 too couldn't get any of the plugins to work, so based on Stefan's response I did the following which works, but annoyingly IntelliJ seems to create group modules, which weren't there before. Be great if anyone has any idea what is causing this I would really like to get this fixed.
apply plugin: 'java'
apply plugin: 'idea'
configurations {
compileDagger
}
def genPath = new File(buildDir,"generated/source/apt/main" )
task createGenPath << {
if(!genPath.exists()){
genPath.mkdirs()
}
}
compileJava.dependsOn(createGenPath)
compileJava {
source += genPath
classpath += configurations.compileDagger
options.compilerArgs += ['-s', genPath]
}
idea.module {
sourceDirs += genPath
}
dependencies {
compileDagger "com.google.dagger:dagger-compiler:${dagger2Version}"
compile "com.google.dagger:dagger:${dagger2Version}"
}