FutureMind/koru

Duplicate files under generated build flavours

Closed this issue · 4 comments

I have similar issue as explained in issue #31

Files are generated for annotated classes under both release/ and debug/ build folders when running ./gradlew assemble on my project. This results in redeclarations of files, as the same files are then found from both paths.

This can be mitigated by explicitly pointing to either debug or release outputs in the build.gradle.kts of the shared module:

kotlin.srcDir("${buildDir.absolutePath}/generated/source/kaptKotlin/")
to
kotlin.srcDir("${buildDir.absolutePath}/generated/source/kaptKotlin/debug/")

Is there a way to go about this without hardcoding the path to the generated outputs of a specific flavour? I've not yet found a way.

I'm not aware of any other way yet but I will look into that.

This will no longer be relevant in ksp version, which I'm planning to release soon.

Fixed in 0.11.1 with ksp