@mbonnin In our app , we have too many number of variants. for ex - debug, staging, release. If i generated code with currently having debug as active build variant, generated files are stored into
build/generated/ksp/debug/kotlin -
this folder
Now if i change my variant to another (for ex - release) - newly generated files will store in to
build/generated/ksp/release/kotlin
1st issue is , I need to mention both directory as source directory in this case. Like this.
applicationVariants.all *{* variant *->*
sourceSets *{*
println("$variant.name")
main *{*
kotlin.srcDirs += ["$buildDir/generated/ksp/$<http://variant.name/kotlin%22|variant.name/kotlin">]
}
}
}
2nd issue : Some build exceptions occurred if both generated folders are available in the build at the same time. If i clean the build and run , it will create only one folder and it runs fine. But otherwise it cause some task failures.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:kaptCnStagingKotlin'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:147)
at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:282)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:145)