"kapt/sources") val stubsDir = File(rootDir, "kapt/stubs") val kaptArgs = mutableMapOf<String, String>() kaptArgs["kapt.kotlin.generated"] = generatedDirPath val plugin = classpathFiles.find { it.name.startsWith(“kotlin-annotation-processing-embeddable”) } return listOf( "-Xplugin=$plugin", "-P", "plugin:org.jetbrains.kotlin.kapt3:sources=$sourceDir", "-P", "plugin:org.jetbrains.kotlin.kapt3:classes=$classesDir", "-P", "plugin:org.jetbrains.kotlin.kapt3:stubs=$stubsDir", "-P", "plugin:org.jetbrains.kotlin.kapt3:apclasspath=$servicesJar", "-P", "plugin:org.jetbrains.kotlin.kapt3:aptMode=stubsAndApt", "-P", "plugin:org.jetbrains.kotlin.kapt3:correctErrorTypes=true", "-P", "plugin:org.jetbrains.kotlin.kapt3:apoptions=${options(kaptArgs)}" ) }