dagger.gradle 591 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
sourceSets.configureEach { sourceSet ->
	tasks.named(sourceSet.compileJavaTaskName).configure {
		options.annotationProcessorGeneratedSourcesDirectory = file("$buildDir/generated/source/apt/${sourceSet.name}")
	}
}

idea {
	module {
		sourceDirs += compileJava.options.annotationProcessorGeneratedSourcesDirectory
		generatedSourceDirs += compileJava.options.annotationProcessorGeneratedSourcesDirectory
		testSourceDirs += compileTestJava.options.annotationProcessorGeneratedSourcesDirectory
		generatedSourceDirs += compileTestJava.options.annotationProcessorGeneratedSourcesDirectory
	}
}