[Gradle] Register default kapt classes dir as an output

#KT-59256 Fixed
This commit is contained in:
Alexander.Likhachev
2023-06-16 14:55:26 +02:00
committed by Space Team
parent b23b9ab287
commit ac79633590
2 changed files with 1 additions and 3 deletions
@@ -1272,7 +1272,6 @@ open class Kapt3IT : Kapt3BaseIT() {
@DisplayName("KT-59256: kapt generated files are included into the test runtime classpath")
@GradleTest
@Disabled("The fix is not yet provided")
fun testKaptGeneratedInTestRuntimeClasspath(gradleVersion: GradleVersion) {
project("kapt-in-test-runtime-classpath".withPrefix, gradleVersion) {
build("test") {
@@ -382,8 +382,7 @@ class Kapt3GradleSubplugin @Inject internal constructor(private val registry: To
// Workaround for changes in Gradle 7.3 causing eager task realization
// For details check `KotlinSourceSetProcessor.prepareKotlinCompileTask()`
if (kotlinCompilation is KotlinWithJavaCompilation<*, *>) {
val kotlinSourceDirectorySet = kotlinCompilation.defaultSourceSet.kotlin
kotlinSourceDirectorySet.compiledBy(taskProvider, KaptTask::classesDir)
kotlinCompilation.output.classesDirs.from(classesOutputDir).builtBy(taskProvider)
} else {
kotlinCompilation.output.classesDirs.from(taskProvider.flatMap { it.classesDir })
}