Filter kapt generate stubs classpath for non-existent entries (KT-37241) (#3192)

Issue #KT-37241 Fixed
This commit is contained in:
Sergey Igushkin
2020-03-16 14:16:35 +03:00
committed by GitHub
3 changed files with 6 additions and 2 deletions
@@ -541,7 +541,7 @@ open class Kapt3IT : Kapt3BaseIT() {
}
@Test
fun testKt19179() {
fun testKt19179andKt37241() {
val project = Project("kt19179", directoryPrefix = "kapt2")
project.build("build") {
@@ -565,6 +565,9 @@ open class Kapt3IT : Kapt3BaseIT() {
":app:kaptGenerateStubsKotlin",
":app:kaptKotlin"
)
// Test for KT-37241, check the that non-existent classpath entry is filtered out:
assertNotContains("Classpath entry points to a non-existent location")
}
project.projectDir.getFileByName("Test.kt").modify { text ->
@@ -1,4 +1,5 @@
apply plugin: 'kotlin'
apply plugin: 'java-library'
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
@@ -92,7 +92,7 @@ open class KaptGenerateStubsTask : KotlinCompile() {
args.pluginOptions = (pluginOptionsWithKapt.arguments + args.pluginOptions!!).toTypedArray()
args.verbose = project.hasProperty("kapt.verbose") && project.property("kapt.verbose").toString().toBoolean() == true
args.classpathAsList = this.compileClasspath.toList()
args.classpathAsList = this.compileClasspath.filter { it.exists() }.toList()
args.destinationAsFile = this.destinationDir
}