@@ -79,6 +79,17 @@ var KotlinCompilation.kspAllWarningsAsErrors: Boolean
7979 registrar.allWarningsAsErrors = value
8080 }
8181
82+ /* *
83+ * Run processors and compilation in a single compiler invocation if true.
84+ * See [com.google.devtools.ksp.KspCliOption.WITH_COMPILATION_OPTION].
85+ */
86+ var KotlinCompilation .kspWithCompilation: Boolean
87+ get() = getKspRegistrar().withCompilation
88+ set(value) {
89+ val registrar = getKspRegistrar()
90+ registrar.withCompilation = value
91+ }
92+
8293private val KotlinCompilation .kspJavaSourceDir: File
8394 get() = kspSourcesDir.resolve(" java" )
8495
@@ -140,6 +151,7 @@ private class KspCompileTestingComponentRegistrar(
140151 var incremental: Boolean = false
141152 var incrementalLog: Boolean = false
142153 var allWarningsAsErrors: Boolean = false
154+ var withCompilation: Boolean = false
143155
144156 override fun registerProjectComponents (project : MockProject , configuration : CompilerConfiguration ) {
145157 if (providers.isEmpty()) {
@@ -153,6 +165,7 @@ private class KspCompileTestingComponentRegistrar(
153165 this .incremental = this @KspCompileTestingComponentRegistrar.incremental
154166 this .incrementalLog = this @KspCompileTestingComponentRegistrar.incrementalLog
155167 this .allWarningsAsErrors = this @KspCompileTestingComponentRegistrar.allWarningsAsErrors
168+ this .withCompilation = this @KspCompileTestingComponentRegistrar.withCompilation
156169
157170 this .cachesDir = compilation.kspCachesDir.also {
158171 it.deleteRecursively()
0 commit comments