Permalink
Browse files

Filter out non-existent java source roots in kapt tasks

    #KT-24716 fixed
  • Loading branch information...
alexey-tsvetkov committed Jun 19, 2018
1 parent 5c04a30 commit 3fb26d92df54cbd8c56ec9da5c24c018cd064c18
@@ -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)
}

0 comments on commit 3fb26d9

Please sign in to comment.