https://kotlinlang.org logo
#kapt
Title
# kapt
r

rbares

11/12/2020, 12:48 PM
Working on an Android library using Gradle, Kotlin and a 3rd-party codegen plugin using kapt, is there a way to have kapt generate sources but to prevent these files being included in the module build artifacts? I am hoping to be able to split the kapt output into a separate AAR (dependent on the original library), avoiding a trail of unnecessary dependencies for those who don't need the generated classes.
Things which don't work:
android.sourceSets.main.java { exclude 'path' }
,
android.packagingOptions { exclude 'path' }
. Can't see a way to configure how Android generates the classes.jar either, so presumably this needs some detailed knowledge of how kapt files are included in the build
4 Views