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:
+1
@@ -46,6 +46,7 @@ fun Project.initKapt(
|
|||||||
kotlinTask.logger.kotlinDebug("kapt: Using class file stubs")
|
kotlinTask.logger.kotlinDebug("kapt: Using class file stubs")
|
||||||
|
|
||||||
val stubsDir = File(buildDir, "tmp/kapt/$variantName/classFileStubs")
|
val stubsDir = File(buildDir, "tmp/kapt/$variantName/classFileStubs")
|
||||||
|
stubsDir.mkdirs()
|
||||||
kotlinTask.extensions.extraProperties.set("kaptStubsDir", stubsDir)
|
kotlinTask.extensions.extraProperties.set("kaptStubsDir", stubsDir)
|
||||||
javaTask.appendClasspathDynamically(stubsDir)
|
javaTask.appendClasspathDynamically(stubsDir)
|
||||||
kotlinTask.appendClasspathDynamically(stubsDir)
|
kotlinTask.appendClasspathDynamically(stubsDir)
|
||||||
|
|||||||
+1
@@ -68,6 +68,7 @@ class KaptIT: BaseGradleIT() {
|
|||||||
assertFileExists("build/classes/main/example/SourceAnnotatedTestClassGenerated.class")
|
assertFileExists("build/classes/main/example/SourceAnnotatedTestClassGenerated.class")
|
||||||
assertFileExists("build/classes/main/example/BinaryAnnotatedTestClassGenerated.class")
|
assertFileExists("build/classes/main/example/BinaryAnnotatedTestClassGenerated.class")
|
||||||
assertFileExists("build/classes/main/example/RuntimeAnnotatedTestClassGenerated.class")
|
assertFileExists("build/classes/main/example/RuntimeAnnotatedTestClassGenerated.class")
|
||||||
|
assertNotContains("w: Classpath entry points to a non-existent location")
|
||||||
}
|
}
|
||||||
|
|
||||||
project.build("build") {
|
project.build("build") {
|
||||||
|
|||||||
Reference in New Issue
Block a user