Skip to content

Commit 9148ec2

Browse files
committed
Workaround to make generated by kapt code visible to IDE
1 parent 158a30a commit 9148ec2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

gradle/kotlin-dagger/build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ buildscript {
1515

1616
apply plugin: 'kotlin'
1717
apply plugin: 'kotlin-kapt'
18+
apply plugin: 'idea'
1819

1920
repositories {
2021
jcenter()
@@ -26,3 +27,13 @@ dependencies {
2627
compile "com.google.dagger:dagger:$dagger_version"
2728
kapt "com.google.dagger:dagger-compiler:$dagger_version"
2829
}
30+
31+
// At the moment for non-Android projects you need to explicitly
32+
// mark the code generated by kapt as 'generated source code'
33+
// for correct highlighting and resolve in IDE.
34+
idea {
35+
module {
36+
sourceDirs += file('build/generated/source/kapt/main')
37+
generatedSourceDirs += file('build/generated/source/kapt/main')
38+
}
39+
}

0 commit comments

Comments
 (0)