Jithin Murali
03/29/2024, 9:44 AMbuild/generated/ksp/variantname/kotlin
Can i able to change this path to a custom path bcoz i had problem with the variant naming.mbonnin
03/29/2024, 9:48 AMJithin Murali
03/29/2024, 10:02 AMbuild/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)
mbonnin
03/29/2024, 10:05 AMkaptCnStagingKotlin
Looks like there another issue in your build. I don't think changing the default KSP output dir here is going to be the solutionJithin Murali
03/29/2024, 10:13 AMbuild/generated/ksp/commonDir/kotlin
If thats the case, there will be no duplicates.
kaptCnStagingKotlin
- When i cleaned the build and run this task it works fine.( Only cnStaging variant generated folders are there)
--> For example if i already have cnRelease variant - generated files and run this task, it throws this exception.hfhbd
03/29/2024, 10:15 AMmbonnin
03/29/2024, 10:16 AMmbonnin
03/29/2024, 10:17 AMCherrio LLC
03/29/2024, 2:44 PMYou should not add the scrDir manually, it should be added by KSP.Not in kmp yet
mbonnin
03/29/2024, 2:46 PMmbonnin
03/29/2024, 2:51 PMeygraber
03/29/2024, 3:45 PMCherrio LLC
03/29/2024, 3:48 PMsrcDir
and also add a dependsOn to all Kotlin Compile.eygraber
03/29/2024, 3:51 PMCherrio LLC
03/29/2024, 4:17 PMeygraber
03/29/2024, 4:25 PM