Filter out non-existent java source roots in kapt tasks

#KT-24716 fixed
This commit is contained in:
Alexey Tsvetkov
2018-06-19 23:46:54 +03:00
parent 5c04a302fa
commit 3fb26d92df
2 changed files with 5 additions and 2 deletions
@@ -22,4 +22,6 @@ dependencies {
compile "org.jetbrains.kotlin:annotation-processor-example:$kotlin_version"
kapt "org.jetbrains.kotlin:annotation-processor-example:$kotlin_version"
testCompile 'junit:junit:4.12'
}
}
compileKotlin.kotlinOptions.allWarningsAsErrors = true
@@ -74,6 +74,7 @@ abstract class KaptTask : ConventionTask() {
.filterTo(HashSet(), ::isRootAllowed)
private fun isRootAllowed(file: File): Boolean =
!FileUtil.isAncestor(destinationDir, file, /* strict = */ false) &&
file.exists() &&
!FileUtil.isAncestor(destinationDir, file, /* strict = */ false) &&
!FileUtil.isAncestor(classesDir, file, /* strict = */ false)
}