In my gradle plugin:
private fun Project.configureCompileArgs() {
val kotlin = extensions.getByType(KotlinMultiplatformExtension::class.java)
kotlin.targets.configureEach { target ->
if (target.fromIosFamily()) {
tasks.withType(KspTaskNative::class.java).configureEach { compileTask ->
compileTask.compilerOptions {
freeCompilerArgs.addAll(
"-P",
"plugin:com.google.devtools.ksp:myCustomParameter=Something"
)
println(">>>>>> ${freeCompilerArgs.get()}")
}
}
}
}
}
running build:
> Configure project :shared
> MyPlugin:
>>>>>> [-P, plugin:com.google.devtools.ksp.myCustomParameter=Something, ....
but when the task (for instance kspKotlinIosArm64 ) runs, there are no params:
> Task :shared:kspKotlinIosArm64
>>>>>>>>>>>>> {}
public class ProcessorProvider : SymbolProcessorProvider {
override fun create(environment: SymbolProcessorEnvironment): SymbolProcessor {
println(">>>>>>>>>>>>>>>>> ${environment.options}")
return Processor(environment.codeGenerator, environment.logger, environment.options)
}
}