Ensure direcory for class file stubs always exists

This fixes the warning "classpath entry does not exist"

    #KT-12352 fixed
This commit is contained in:
Alexey Tsvetkov
2016-06-15 19:30:39 +03:00
parent af10c13ef1
commit 5e21af7bdd
2 changed files with 2 additions and 0 deletions
@@ -46,6 +46,7 @@ fun Project.initKapt(
kotlinTask.logger.kotlinDebug("kapt: Using class file stubs")
val stubsDir = File(buildDir, "tmp/kapt/$variantName/classFileStubs")
stubsDir.mkdirs()
kotlinTask.extensions.extraProperties.set("kaptStubsDir", stubsDir)
javaTask.appendClasspathDynamically(stubsDir)
kotlinTask.appendClasspathDynamically(stubsDir)
@@ -68,6 +68,7 @@ class KaptIT: BaseGradleIT() {
assertFileExists("build/classes/main/example/SourceAnnotatedTestClassGenerated.class")
assertFileExists("build/classes/main/example/BinaryAnnotatedTestClassGenerated.class")
assertFileExists("build/classes/main/example/RuntimeAnnotatedTestClassGenerated.class")
assertNotContains("w: Classpath entry points to a non-existent location")
}
project.build("build") {